Hi Lynton,
When one sets the time on the RTC I assume the most granular control available is the second?
Yes, that is exactly right. When you set the time using set_time(), it configures the SEC, MIN, HOUR, ... registers of the RTC hardware.
When I set the RTC I have a need to zero the seconds so they are truly zero and not 300mS into the second or whatever. Ideally I think I need a MILLISEC register as well as SECONDS, HOURS, MINS etc etc! Either that or I need to be able to resync the 1Hz timing pulse into the RTC so it restarts when I want it to. Or have I got this totally wrong ? I'm not even sure I have explained this too well but hopefully you'll get what I mean??!!
I think I do get what you mean! There are no sub-second registers exposed to software, so you cant set at sub-second granularity; the RTC receives a 1Hz clock.
However, it does look like there is a way to reset the internal elements of the RTC divider, which would effectively have the same result as setting the sub-second elements to zero. It looks like we could therefore include this as part of the setting procedure, so both setting the time and ensuring the divider is cleared.
We could perhaps enhance the library to that behaviour assuming that is what you are after?
Simon
When one sets the time on the RTC I assume the most granular control available is the second?
When I set the RTC I have a need to zero the seconds so they are truly zero and not 300mS into the second or whatever.
Ideally I think I need a MILLISEC register as well as SECONDS, HOURS, MINS etc etc! Either that or I need to be able to resync the 1Hz timing pulse into the RTC so it restarts when I want it to.
Or have I got this totally wrong ?
I'm not even sure I have explained this too well but hopefully you'll get what I mean??!!
Regards
Lynton