cancel
Showing results for 
Search instead for 
Did you mean: 

rtc interrupt service routine not woring

vitthal muddapur
Associate II
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.

18 REPLIES 18
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 

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 III
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.

Posted on February 12, 2018 at 09:15

Did you look in the reference manual ?

which one ?

what page are you on ?

which register is not being set ?

Posted on February 12, 2018 at 09:22

RM0367 Reference manual Ultra-low-power STM32L0x3 advanced ARM®-based 32-bit MCUs

page 662

register are set but doesn,t goes to the isr service routine,set the interrupt flag ISR register

Posted on February 12, 2018 at 09:24

i have enabled alarm and alarm interrupt using register RTC->CR = RTC_CR_ALRAIE | RTC_CR_ALRAE;

Posted on February 12, 2018 at 09:38

I didn't use the RTC before, my RTC is off chip to be more stable

this looks dodgy to me.

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.);
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

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 .......