cancel
Showing results for 
Search instead for 
Did you mean: 

How to achieve 1ms resolution (subsecond) from the RTC on stm32L476 MCU.

JLitt
Associate II

I have a LSE with a freq of 32.768KHz. The cube generated code uses values for  

AsynchPrediv   = 127;

SynchPrediv    = 255;

These values give around ~4ms resolution. Is it possible to get to ~1ms resolution?

Thanks

3 REPLIES 3
S.Ma
Principal

Do you intend to use RTC only for msec delay? Otherwise a low power timer based on HSE should do the job.

JLitt
Associate II

I'm using the RTC to get a time stamp down to the millisecond for data logging purposes. Is there a way to synchronize a low power timer with the RTC?

Thanks!

Change the ratio between asynchronous and synchronous prescaler. Cut asynchronous down to a quarter of what's now (don't forget that the value in register is one less than the dividing ratio) and compensate by increasing the synchronous by the same factor.

JW