2009-05-01 07:42 AM
Alarm interrupt using RTC
2011-05-17 04:03 AM
2011-05-17 04:03 AM
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 late2011-05-17 04:03 AM
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);