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

RTC interrupt is not servicing

hi, I have written the following code for LPC2148. RTC is generating an interrupt after every sec. but the prob is, only once the interrupt is getting serviced though it should be serviced every sec. Means, first time the interrupt occur, it is serviced, but after that, occurrence of interrupt has no effect on execution.
NOTE: the code I'm uploading is not starting a new instruction in new line. please, try to understand the code. my code:

AREA college_bell,CODE, READONLY EXPORT RTC

RTC ;to clear all interrupts ldr r0,=VICIntEnClr mov r1,#0xffffffff str r1,[r0]

;to clear all fiq selections ldr r0,=VICIntSelect mov r1,#00 str r1,[r0]

; point unvectored IRQs to this address ; ldr r2,=VICDefVectAddr

;to set input/output ports ; declared as output pins ldr r1,=IO1DIR ldr r0,=0x00ff0000 str r0,[r1]

main BL initialize_rtc BL set_clock

loop b loop

initialize_rtc ldr r0,=ILR ;clear interrupt flag ldr r1,[r0] orr r1,r1,#3 str r1,[r0]

ldr r0,=CCR ;clock enable + external crystal enable mov r1,#0x11 str r1,[r0]

ldr r0,=CIIR ; to interrupt every sec mov r1,#0x01 str r1,[r0]

ldr r0,=VICVectAddr1 ;to set interrupt vector in 1 ldr r1,=interrupt str r1,[r0]

ldr r0,=VICVectCntl1 ;to use it for RTC interrupt ldr r1,=0x0000002d str r1,[r0]

ldr r0,=VICIntEnable ;to enable RTC interrupt ldr r1,=0x00002000 str r1,[r0]

bx lr

set_clock ldr r0,=YEAR ;YEAR ldr r1,=2010 str r1,[r0]

ldr r0,=MONTH ;month mov r1,#4 str r1,[r0]

ldr r0,=DOM ;Day of Month mov r1,#10 str r1,[r0]

ldr r0,=HOUR ; hour mov r1,#22 str r1,[r0]

ldr r0,=MIN ; min mov r1,#45 str r1,[r0]

ldr r0,=SEC ;sec mov r1,#56 str r1,[r0]

bx lr

interrupt ldr r0,=ILR ;clear interrupt flag ldr r1,[r0] orr r1,r1,#3 str r1,[r0]

ldr r0,=VICVectAddr1 ;to set interrupt vector in 1 ldr r1,=interrupt str r1,[r0]

ldr r0,=VICVectAddr ;acknowledge interrupt ldr r1,[r0] mov r1,#0 str r1,[r0]

;to come back to user mode MSR CPSR_c,#0x00000010

ldr r2,=IO1SET ldr r3,=IO1CLR

mvn r4,#0xffffffff str r4,[r3]

ldr r5,=CTIME0 ldr r5,[r5] ldr r6,=0x0000ffff AND r5,r5,r6 mov r5,r5,lsl#8 str r5,[r2] b loop

END

Please help me find out why is it so?