Rena
Active member
The register `RTC_TSR` contains the counter in seconds, and `RTC_TPR` contains fractional seconds, but what's the proper way to read both? If I read one and then the other, it's possible the TSR increments between reads, so the resulting value will be off by almost a whole second. Is there some "atomic 64-bit read" I can use? Should I stop the counter before every read?
Also, the datasheet claims that the TSR increments when bit 14 of TPR transitions to zero. Is this correct? So the TPR counts in increments of 1/16384 second, not 1/32768? Is this intended to provide a solution to the race condition? Or is this a typo? From my tests it does seem to be counting 1/32768 second.
Also, the datasheet claims that the TSR increments when bit 14 of TPR transitions to zero. Is this correct? So the TPR counts in increments of 1/16384 second, not 1/32768? Is this intended to provide a solution to the race condition? Or is this a typo? From my tests it does seem to be counting 1/32768 second.