This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Keil MCB2300 RTC problem

I want to switch on the LEDs after 3 seconds using the RTC

This is my initialization
int main(void)
{ init_io();

PCONP |= 0X200;

FIO2CLR = 0x00; RTC_CCR = 0x12; //ctc reset and select RTC clock from 32 RTC_ILR = 0xFF; //Clear RTC interrupt register RTC_AMR = 0x000000FE; //Enable seconds alarm RTC_ALSEC = 0x00000003; //set alarm register for 3 seconds RTC_CISS = 0; //Disable all subsecond interrupts RTC_CCR = 0x11; //Enable RTC RTC_CIIR = 0x01;

VICVectAddr13 = (unsigned)isr_rtc_event; VICVectCntl13 = 13; VICIntEnable = (1<<13);

void isr_rtc_event(void) __irq
{ if(RTC_ILR &= 0x00000001) {

FIO2SET = 0XFF;

RTC_ILR = 0x00000001; rtc_update = 1; }

VICVectAddr = 0x00000000;
}

What I thought is that after 3 seconds the interrupt will be fired and the LEDs will light but this does not seem to be happening. Does anyone know where im going wrong

Parents Reply Children
No data