cancel
Showing results for 
Search instead for 
Did you mean: 

RTC Alarm trigger at end of second

kchuva
Associate II
Posted on January 17, 2013 at 06:09

Hi all.

I develop embedded software on STM32F103RC. And I having some problem with RTC Alarm. It triggers interrupt at end of second. Because of this I don't call some methods at the same second.

I use LSE and prescaler is 32767. Any ideas? 

Anyone encountered this problem?

Anyone encountered this problem

#rtc-alarm-interrupt
2 REPLIES 2
kchuva
Associate II
Posted on January 17, 2013 at 08:35

I find answer on my question. RTC Alarm has that behaviour because The RTC_Alarm and RTC Alarm flag (ALRF)  are asserted on the last RTC Core clock cycle before the counter reaches the RTC Alarm value stored in the Alarm register increased by one (RTC_ALR + 1).

But I don't solve my problem, because I need RTC Alarm interrupt at the moment when RTC Counter is equal RTC Alarm value. 

Also I have another question: what's difference between RTC_IRQHandler and RTCAlarm_Handler?

kchuva
Associate II
Posted on January 17, 2013 at 14:01

Close the subject. I solve my problem.

Solution is very simple. I set alarm at time-1 and delay 1 ms in order to start my operation at begin of second boundary.