cancel
Showing results for 
Search instead for 
Did you mean: 

RTC to Time Interrupt

btan
Associate II
Posted on May 05, 2011 at 06:25

RTC to Time Interrupt

#rtc
3 REPLIES 3
btan
Associate II
Posted on May 17, 2011 at 14:33

Thanks for point that out.  That fixed it and I need to read manual more carefully next time.  And the reason I'm using RTC instead of standard timer is I need both high precision (2^15 in RTC is sufficient) and high accuracy over a long period, say couple hours.

Thasks again,

Ben
Posted on May 17, 2011 at 14:33

First up, the overflow is for the 32-bit second counter, NOT your 32-bit prescale/divider register holding your fractional second. You'd surely want to be observing the second flag?

If you want 1/2^15 fraction accuracy for your seconds, the smart move would be to read your register sets twice, until they don't change. Pretty sure this can be done within a 30.5 us window.

Not sure why you're bothering with something that course given you have a 32-bit source with 1.4e-8 second granularity in a single indivisible read available in the core. Presuming of course your interrupts run in less than a minute.

 

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on May 17, 2011 at 14:33

Using SysTick/CoreTick the aforementioned precision could be pulled over a century. I would suspect a HSE using a cheap TCXO would afford an accuracy several of orders better than an uncompensated crystal.

I'd certainly avoid using the LSI, it is neither accurate nor stable.

For that matter, you can also run the RTC from the HSE, and with a common clock source for the core and the RTC you wouldn't get any drift, perhaps some VCO/PLL jitter.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..