AnsweredAssumed Answered

RTC problem with kl46z

Question asked by Florian DJAMBAZIAN on Oct 25, 2016
Latest reply on Oct 26, 2016 by Florian DJAMBAZIAN

Hi every body,

I'am a newbe with my kl46z board and I try to generate an one second interruption with the RTC. Here is the program :

//test
MCG_C1 |= MCG_C1_IRCLKEN_MASK;
MCG_C2 &= ~(MCG_C2_IRCS_MASK);
//Enable Clock for RTC
SIM_SCGC6 |= SIM_SCGC6_RTC_MASK;

//Enable interrupt second
RTC_IER |= 0x10;
RTC_IER &= 0xfffffff8;
NVIC_EnableIRQ(21);
//Chose Clk OSC32KCLK
SIM_SOPT1 |= 0x00000000;

//ENable OSCE
RTC_CR |= 0x100;

//To clear the Time invalid Flag
RTC_TSR =0x01;
//Enable RTC
RTC_SR |= 0x10;

 

But at the end I never go to interruption. If you have any idea that could help me please ?

Outcomes