Skip to main content
vaibhav
Associate II
May 1, 2009
Question

Alarm interrupt using RTC

  • May 1, 2009
  • 3 replies
  • 720 views
Posted on May 01, 2009 at 16:42

Alarm interrupt using RTC

    This topic has been closed for replies.

    3 replies

    jramirez
    Associate
    May 17, 2011
    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);

    jramirez
    Associate
    May 17, 2011
    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

    vaibhav
    vaibhavAuthor
    Associate II
    May 17, 2011
    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