i use RTC to generate an ALARM. i have a function that sets the values of ALHOUR and ALMIN. after doing that i call a function (see below) that handles the interrupt initialization. immediately when i call this function an interrupt is generated even though time condition is not matched. when time condition is matched interrupt is not asserted.
/***************************/ /* Init ALARM */ /***************************/ void ALARM_init (void) { RTC_AMR = 0xFF; //Mask all bits RTC_AMR &= 0xF9; //enable MIN,HOUR /* Setup the VIC */ VICIntEnClr |= 1<<13; // clear 13th bit (is the RTC) VICVectAddr13 = (unsigned long int) &start_ALARM_ISR; VICVectCntl13 = 0x07; // Interrupt priority VICIntEnable |= 1<<13; //enable RTC interrupt, 13th bit return; } /***************************/ /* ALARM ISR */ /***************************/ void start_ALARM_ISR (void) __irq {