AnsweredAssumed Answered

[STM32L152] 1 Hz interrupts using an external 32.768 oscillator and RTC clock

Question asked by Tiilt on Oct 16, 2013
Latest reply on Oct 17, 2013 by Tiilt
Hey everyone,

I'm currently trying to generate 1 Hz interrupts using the LSE oscillator of my STM32L discovery board. I have already configured my RTC clock succesfully. My problem is as follow: I know that the STM32F serie offers RTC overflow interrupts to generate an interrupt every second, upon checking, it doesn't seem that the STM32L series has the same features (I've only seen RTC wake up and alarm interrupts). That being said I was wondering if there was a way around, i.e. can I use the same 32.768 oscillator I use for RTC as clock source for one of the Timers (TIMx) ? My project involves measuring a voltage every second and saving it in an array along with the time at which it was measured. Ideally, I'd like to use the same clock source to trigger the measure and get the time at which it was performed. I know I could set up a TIMx timer to generate interrupts every second using the internal oscillator. However I'm concerned that the difference in accuracy and drift that would occur between the two separate clock sources will cause trouble. I will be taking measures over long periods (typically weeks or months), and if the internal timer runs slightly slower than the RTC, there is a high risk I am gonna get two measures in one second, or one second will be skipped periodically ...

Thanks in advance for any help you can provide

Cheers,

Quin 

Outcomes