Page 1 of 1

RTC does not start?

Posted: Thu Mar 10, 2016 1:18 pm
by NielsClausen
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 8343 times

Re: RTC does not start?

Posted: Thu Mar 10, 2016 8:11 pm
by chuckbook
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).

Re: RTC does not start?

Posted: Fri Jul 15, 2016 7:18 am
by saulo
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

Re: RTC does not start?

Posted: Fri Jul 15, 2016 7:30 am
by pythoncoder
@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.

Re: RTC does not start?

Posted: Fri Jul 15, 2016 8:32 am
by saulo
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 8058 times
wiring.jpg
wiring.jpg (107.77 KiB) Viewed 8058 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. :|

Re: RTC does not start?

Posted: Fri Jul 15, 2016 9:06 am
by pythoncoder
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

Re: RTC does not start?

Posted: Fri Jul 15, 2016 3:33 pm
by saulo
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?

Re: RTC does not start?

Posted: Fri Jul 15, 2016 4:02 pm
by dhylands
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.

Re: RTC does not start?

Posted: Fri Jul 15, 2016 4:27 pm
by pythoncoder
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.

Re: RTC does not start?

Posted: Fri Jul 15, 2016 9:40 pm
by saulo
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.