AnsweredAssumed Answered

problems with rtc interrupt

Question asked by stefan mayer on May 1, 2012
Latest reply on May 3, 2012 by Daniel Lundin

hello, have problems with my rtc interrupt. i want to test the code in debug mode , but the interrupt service routine is never called..


controller: mc9s08JM60


please can anyone view my code and say if there is something wrong


#include <hidef.h> /* for EnableInterrupts macro */#include "derivative.h" /* include peripheral declarations */#include "MCUinit.h"#ifdef __cplusplusextern "C"#endifvoid MCU_init(void); /* Device initialization function declaration */Bool Tick = FALSE;void main(void) {  MCU_init(); /* call Device Initialization */  EnableInterrupts;    RTCMOD= 0x00;  RTCSC = 0x1F | 0x80;  for(;;){   if (Tick == TRUE)   {  RTCMOD = 0x00;//Re-setting the counter value  RTCSC = 0x1F; //Re-enabling the interrupt re-configuring the clock source  Tick = FALSE;   }  }}__interrupt void RTC_ISR(void){ RTCSC = RTCSC | 0x80; Tick = TRUE;}