cancel
Showing results for 
Search instead for 
Did you mean: 

RTC ALarm Interrupt

amano_ginji_39
Associate II
Posted on October 03, 2007 at 12:24

RTC ALarm Interrupt

1 REPLY 1
amano_ginji_39
Associate II
Posted on May 17, 2011 at 12:16

Hi everyone,

I am two problem with RTC.

For RTC Alarm interrup, i must write my program in RTC_IRQHandler but for RTC alarm. When I'm in debug mode, the flag ALRIE and ALRF is set when a interrupt occur but the program go in RTC_IRQHandler;

void RTC_IRQHandler(void){

if(RTC_GetITStatus(RTC_IT_SEC) != RESET){

RTC_ClearITPendingBit(RTC_IT_SEC);

TimeDisplay = 1;

RTC_WaitForLastTask();

SystemDateTime.seconde++;

if(RTC_GetITStatus(RTC_IT_ALR) != RESET){

RTC_ClearITPendingBit(RTC_IT_ALR);

RTC_WaitForLastTask();

RTC_SetAlarm(RTC_GetDateTime()+10);//Actual Time + 10sec

RTC_WaitForLastTask();

AlarmDisplay=1;

}

}

The second probleme is when I run the programme, alarm interrupt do action but no always 10-11s