AnsweredAssumed Answered

Wake-Up Timer T2WUFD interrupt

Question asked by Fox1 on Dec 28, 2012
Latest reply on Jan 8, 2013 by Fox1

I have some troubles with Wake-Up Timer.

I use WutLib as in example Timers.

 

WutCfg(T2CON_MOD_PERIODIC, T2CON_WUEN_DIS, T2CON_PRE_DIV16, T2CON_CLK_PCLK);    // T2 config, PCLK/16, periodic mode,

WutCfgInt(T2IEN_WUFD, 1);                                                        // Interrupt on compare to D register

WutLdWr(3,1000);                                                                               // Set the timeout period as 1mS

WutGo(T2CON_ENABLE_EN);                                                     // Start wake-up timer

NVIC_EnableIRQ(WUT_IRQn);                                                     // Enable Timer2 IRQ

 

I Get the interrupt and try to clear T2WUFD interrupt flag in T2STA.

 

WutClrInt(T2CLRI_WUFD);

 

But the flag remain active and I get new interrupt immediately after return from interrupt handler (I see it in IAR IDE in Register window).

Can you explain where is the mistake?

 

The same situation with example Timers. Bit WUFD in T2STA always set and WutClrInt can’t clear it.

 

Best regards.

 

 

 

 

Best regards.

Outcomes