rtc.info()

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
Lakshana
Posts: 3
Joined: Thu Aug 02, 2018 12:52 am

rtc.info()

Post by Lakshana » Tue Oct 16, 2018 5:39 am

Hi,
I'm not able to understand the function of rtc.info(). When I enter this command in the REPL, I get an output which says 262147. The documentation says it gives information about the startup time and reset source.
-The lower 0xffff are the number of milliseconds the RTC took to start up.
-Bit 0x10000 is set if a power-on reset occurred.
-Bit 0x20000 is set if an external reset occurred.
I don't understand what this means. Can someone help me please?

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

Re: rtc.info()

Post by pythoncoder » Tue Oct 16, 2018 6:34 am

If you issue

Code: Select all

>>> hex(262147)
'0x40003'
>>> 
you will see that bits 0x10000 and 0x20000 are zero. Your RTC took 3ms to start up.

If this isn't clear I suggest you look up information on binary and hexadecimal numbers. This forum is for MicroPython specific queries and it's not practicable to offer one-to-one tuition on basic programming topics.
Peter Hinch
Index to my micropython libraries.

Post Reply