Skip to main content
vitthal muddapur
Associate III
February 10, 2018
Question

rtc interrupt service routine not woring

  • February 10, 2018
  • 18 replies
  • 2261 views
Posted on February 10, 2018 at 09:59

hi,

ALRAF bit is set in ISR register but doesn,t execute the rtc-irq handler.

i enabled NVIC_RTC.

    This topic has been closed for replies.

    18 replies

    straubm
    Associate II
    February 10, 2018
    Posted on February 10, 2018 at 12:22

    What's the configuration? MCU? CubeMX and/or LL-drivers in use ?

    vitthal muddapur
    Associate III
    February 12, 2018
    Posted on February 12, 2018 at 07:53

    MCU CONFIGURATION

    Jack Peacock
    Visitor II
    February 10, 2018
    Posted on February 10, 2018 at 15:05

    Did you also enable the EXTI line for RTC alarm?

    vitthal muddapur
    Associate III
    February 12, 2018
    Posted on February 12, 2018 at 08:29

    no

    Tesla DeLorean
    Guru
    February 10, 2018
    Posted on February 10, 2018 at 16:10

    Chronically vague, provide context.

    Show code, show detail

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    vitthal muddapur
    Associate III
    February 12, 2018
    Posted on February 12, 2018 at 08:07

    void RTC_ALRMAR_SET()

    {

    RTC->WPR = 0xCA;

    RTC->WPR = 0x53;

    RTC->CR &=~ RTC_CR_ALRAE;

    while((RTC->ISR & RTC_ISR_ALRAWF) != RTC_ISR_ALRAWF)

    {

    }

    RTC->ALRMAR = RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | 1<<30(Week day selection mask) | 1<<4(set Second tens in BCD format.);

    RTC->CR = RTC_CR_ALRAIE | RTC_CR_ALRAE;

    RTC->WPR = 0xFE;

    RTC->WPR = 0x64;

    }

    trying to get interrupt at 10 sec but not working 

    henry.dick
    Associate II
    February 10, 2018
    Posted on February 10, 2018 at 18:38

    The bug is obvious: you just need to set the 3rd bit 38th line down on the 2nd page of your 8th function about 2/3 logic high. As now, it is not high enough.

    T J
    Senior III
    February 12, 2018
    Posted on February 12, 2018 at 08:43

    Which IDE are you using ?

    can you check the registers with single step ?

    You could read the Reference manual to find all the register descriptions.

    your problem would be in there, as a guess.

    vitthal muddapur
    Associate III
    February 12, 2018
    Posted on February 12, 2018 at 08:54

    KEIL 5

    set alarm interrupt flag in isr doesn't go to the isr routine 

    please help me 

    vitthal muddapur
    Associate III
    February 12, 2018
    Posted on February 12, 2018 at 08:55

    code is 

    void RTC_ALRMAR_SET()

    {

    RTC->WPR = 0xCA;

    RTC->WPR = 0x53;

    RTC->CR &=~ RTC_CR_ALRAE;

    while((RTC->ISR & RTC_ISR_ALRAWF) != RTC_ISR_ALRAWF)

    {

    }

    RTC->ALRMAR = RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | 1<<30(Week day selection mask) | 1<<4(set

    Second tens in BCD format.);

    RTC->CR = RTC_CR_ALRAIE | RTC_CR_ALRAE;

    RTC->WPR = 0xFE;

    RTC->WPR = 0x64;

    }

    straubm
    Associate II
    February 12, 2018
    Posted on February 12, 2018 at 10:15

    In STM32L0x3 - according to the reference manual - RTC interrupts are routed to EXTI line 17. Did you enable this line?

    EDIT: reference manual pg. 659 ff and pg. 285 ff.

    vitthal muddapur
    Associate III
    February 12, 2018
    Posted on February 12, 2018 at 10:35

    Thank you 

    i have not set EXTI Line 17.

    after set it's working right now 

    thank you very much

    straubm
    Associate II
    February 12, 2018
    Posted on February 12, 2018 at 10:58

    Welcome. But then Jack Peacock mentioned the EXTI line issue on Feb 10th, asking you, whether you had enabled it. You simply answered 'no' and obviously did not look into it. Maybe there is something to learn from this .......