RTC does not start?

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
NielsClausen
Posts: 14
Joined: Sun Dec 13, 2015 5:31 pm

RTC does not start?

Post by NielsClausen » Thu Mar 10, 2016 1:18 pm

The RTC on my pyboard v1.1 will not work now? It used to work however (before wiring it up to external chips). I have this MWE, but it yields nothing but the date, Jan. 1. 2000... WHY?

Code: Select all

import pyb
rtc = pyb.RTC()
print(rtc.datetime())
rtc.datetime((2016,3,10,4,9,30,10,0))
print(rtc.datetime())
pyb.delay(2000)
print(rtc.datetime())
I have played a bit with external powering of the board (not from USB, but through V+) - could that have interfered? I also have wires on many pins (
Screen Shot 2016-03-10 at 13.59.16.png
Screen Shot 2016-03-10 at 13.59.16.png (64.43 KiB) Viewed 8266 times

chuckbook
Posts: 135
Joined: Fri Oct 30, 2015 11:55 pm

Re: RTC does not start?

Post by chuckbook » Thu Mar 10, 2016 8:11 pm

What is the output of rtc.info()?
After a full power cycle, including Vbat. Best to leave the board un-powered for a reasonable amount of time (1..2 minutes).

User avatar
saulo
Posts: 16
Joined: Thu May 26, 2016 9:05 am
Location: Brasil

Re: RTC does not start?

Post by saulo » Fri Jul 15, 2016 7:18 am

chuckbook wrote:What is the output of rtc.info()?
After a full power cycle, including Vbat. Best to leave the board un-powered for a reasonable amount of time (1..2 minutes).
I have the same problem... i put a coil battery on vbat for five minutes and all leds turn on very weaks.. after that, i connected usb and the leds blinks normally:

Code: Select all

>>> rtc.datetime()
(2000, 1, 1, 1, 0, 0, 0, 0)
>>> rtc.datetime()
(2000, 1, 1, 1, 0, 0, 0, 0)
>>> rtc.datetime()
(2000, 1, 1, 1, 0, 0, 0, 0)
>>> rtc.datetime()
(2000, 1, 1, 1, 0, 0, 0, 0)
>>> rtc.datetime()
(2000, 1, 1, 1, 0, 0, 0, 0)
>>> rtc.info()
262147

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: RTC does not start?

Post by pythoncoder » Fri Jul 15, 2016 7:30 am

@saulo With a battery providing 3V or thereabouts to vback and no power applied to V+ the LED's should not be on. I'd suggest checking your wiring.
Peter Hinch
Index to my micropython libraries.

User avatar
saulo
Posts: 16
Joined: Thu May 26, 2016 9:05 am
Location: Brasil

Re: RTC does not start?

Post by saulo » Fri Jul 15, 2016 8:32 am

pythoncoder wrote:@saulo With a battery providing 3V or thereabouts to vback and no power applied to V+ the LED's should not be on. I'd suggest checking your wiring.
Take a look pythoncoder:
leds_on.jpg
leds_on.jpg (199.49 KiB) Viewed 7981 times
wiring.jpg
wiring.jpg (107.77 KiB) Viewed 7981 times
i can't see nothing wrong :cry:

RTC works fine without battery, but i have to update datetime every time.. i was using the GPS to do that but it's quite annoying and not work indoor. :|

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: RTC does not start?

Post by pythoncoder » Fri Jul 15, 2016 9:06 am

saulo wrote:i can't see nothing wrong :cry:
I can. The RTC backup battery should be connected between vbak and gnd. The terminals you're using are for a LiPo battery. See https://micropython.org/static/store/im ... v1_1-E.jpg
Peter Hinch
Index to my micropython libraries.

User avatar
saulo
Posts: 16
Joined: Thu May 26, 2016 9:05 am
Location: Brasil

Re: RTC does not start?

Post by saulo » Fri Jul 15, 2016 3:33 pm

pythoncoder wrote:
saulo wrote:i can't see nothing wrong :cry:
I can. The RTC backup battery should be connected between vbak and gnd. The terminals you're using are for a LiPo battery. See https://micropython.org/static/store/im ... v1_1-E.jpg
:oops: my bad! i correct the wiring and it's working now :mrgreen: thank you pythoncoder!

About battery pin, if i use a 1S lipo battery, i don't need power over VIN/USB right? There is not any battery management like a recharger over VIN/USB to VBAT right?

my VIN and 3V3 pins are supplied by VBAT and VIN/USB?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: RTC does not start?

Post by dhylands » Fri Jul 15, 2016 4:02 pm

Wow - that's confusing.

On the older boards, VBACK used to be called VBAT.

VIN/VUSB/VBAT should all be alternate power sources for the onboard regulator. The 3V3 pin is powered from that regulator.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: RTC does not start?

Post by pythoncoder » Fri Jul 15, 2016 4:27 pm

My understanding is that if you connect a LiPo battery the Pyboard will draw power from it if USB is not connected. If USB is connected, power will be drawn from there. There is no mechanism for charging the LiPo battery on the Pyboard.
Peter Hinch
Index to my micropython libraries.

User avatar
saulo
Posts: 16
Joined: Thu May 26, 2016 9:05 am
Location: Brasil

Re: RTC does not start?

Post by saulo » Fri Jul 15, 2016 9:40 pm

dhylands wrote:Wow - that's confusing.

On the older boards, VBACK used to be called VBAT.

VIN/VUSB/VBAT should all be alternate power sources for the onboard regulator. The 3V3 pin is powered from that regulator.
Maybe that's why i wire wrong :roll:, i've gathered information in posts but i was not paying attention in pyboard version, thanks for the tip.
pythoncoder wrote:My understanding is that if you connect a LiPo battery the Pyboard will draw power from it if USB is not connected. If USB is connected, power will be drawn from there. There is no mechanism for charging the LiPo battery on the Pyboard.
Got it, thanks again for your help, i really appreciate it.

Post Reply