RTC_hooks

Questions about the BASICtools and MakeItC
Post Reply
olzeke51
Posts: 358
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

RTC_hooks

Post by olzeke51 » Sat May 25, 2019 10:58 pm

I was updating my RTC_fake.bas file to use the printf/sprintf BASIC words instead of characters (for the 0).
.it got me to thinking....
?1) are the hooks for HOUR/DAY/MINUTE etc in all of the firmwares or just those with RTC-ability?
.
?2) is there some way, [perhaps via an ISR] to utilize those functions if available in the firmware?
. perhaps pointers to the Variables themselves?
.
again, Just kind of thinking out loud.
Thanks, Olzeke



basicchip
Posts: 956
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Re: RTC_hooks

Post by basicchip » Sat May 25, 2019 11:42 pm

Way back when the LPC21xx devices and many other RTCs, actually had hardware to count seconds to minutes to hours to days to months to years including leap years. That is actually a lot of hardware.

These days most RTCs, are just done by counting milliseconds or seconds and then letting the software figure out when it is. A much smaller solution as Flash space for code is smaller than hardware counters. This includes PCs which just count raw milliseconds based on a start time.

The trend is to go to just counting seconds in micro-CPUs, as that is less power, the counter increments just once a second rather than 1000 times a second, And battery life and low power are the desired traits these days.

Post Reply