cancel
Showing results for 
Search instead for 
Did you mean: 

Alarm interrupt using RTC

vaibhav
Associate II
Posted on May 01, 2009 at 16:42

Alarm interrupt using RTC

3 REPLIES 3
vaibhav
Associate II
Posted on May 17, 2011 at 13:03

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6YJ&d=%2Fa%2F0X0000000bqY%2Fx_zYVkzgsD83ELRWRwRA9mnim6tZLxKd0pk83FiIkzM&asPdf=false
jramirez
Associate II
Posted on May 17, 2011 at 13:03

hi,

Maybe you have solved this problem by now, but anyways heres my answer you said you wanted to use the alarm interrupt but in the function NVIC you call NVIC_InitStructure.NVIC_IRQChannel = RTC_IRQChannel; there is actually two handlers I actually made the same mistake but the opposite direction there are tow handlers if you scroll down on your stm32...it.c file youll see the RTCAlarm_IRQ and the RTC_IRQ anyways just change that in the NVIC function and it should work, and if it does let me know because for some reason i cant get the alarm interrupt to work but i had no issues with the sec interrupt hope its not too late

jramirez
Associate II
Posted on May 17, 2011 at 13:03

also when you set the alarm dont do this:

RTC_SetCounter(0x00015170);

RTC_ALR_FLAG = 0x00015170 + 2 ;

RTC_SetAlarm((RTC_ALR_FLAG));

since you dont know for sure that the counter is at that value still. of course if you set up the tick to be every 1 second then i guess its ok, a better way i think is like this.

/* Alarm in 3 second */

RTC_SetAlarm(RTC_GetCounter()+3);