cancel
Showing results for 
Search instead for 
Did you mean: 

Does RTC 1Hz calibration align to 1 second boundary?

DWann
Associate III

I'm trying to get an RTC timestamp from an external event down to the us. My plan is to output the 1Hz calibration from the RTC and externally tie that to TIM8-CH1 as an input capture (reset-on-capture). The external event would route to the RTC timestamp pin and TIM8-CH2 as a regular input capture. Therefore, when the event fires, I get an RTC timestamp plus us since the last 1-second boundary.

However, this is all dependent on the 1Hz calibration output being aligned to 1 second RTC boundaries. I don't know if this is the case or not.

I'm also open to alternative approaches to getting 1us RTC resolution.

This is for the STM32U585.

2 REPLIES 2
DWann
Associate III

I suppose I can just use the RTC alarm and avoid the question altogether.

However, is there a more elegant solution that can be done internal to the MCU? It would be nice to not have to connect 2 pins together to do this.

> However, this is all dependent on the 1Hz calibration output being aligned to 1 second RTC

> boundaries. I don't know if this is the case or not.

I don't understand your question.

Does this answer it?

0693W00000LyO2AQAV.pngHowever, you still may be disappointed by the fact that the 1Hz signal may easily exhibit jitter of a couple of us, as the LSE oscillator output fluctuates around the decision point of the subsequent input comparator.

You can also run a timer at 1MHz, using the usual tricks to "extend" its range, and resyncing it with RTC from time to time "manually"/using purely software. IMO you should be able to achieve 1us resolution running well-crafted code in a nominally 100MHz+ processor. The input signal then needs to be connected only to the timer.

JW