TUBE IRQ occurred incorrectly
What looks like is happening is that the ARM isn't clearing the CTI interrupt quickly enough (through the CS_WRITE CTI1, 0xee8, r5 command) which is causing r4 to increment to 2 in the IRQ_Handler. In the IRQok branch, it tries to compare r4 to 1 which obviously fails.
Thanks in advance for any input or help!
josh
; 2) CTI driving nIRQ
MESSAGE "Check nIRQ"
; Make an IRQ go to the IRQ handler
SET_EXCEPTION IRQ, IRQ_Handler
; Clear r4, this will be set by the IRQ handler
MOV r4, #0
; r6 contains a count used to catch an error if the IRQ fails
; to occur
MOV r6, #30
; Assert nIRQ using the CTI (bit 2 of register 0xee8)
MOV r5, #0x4
CS_WRITE CTI1, 0xee8, r5
; Sit in this loop, waiting for the IRQ to occur
0
SUBS r6, r6, #1
BNE %b0
B IRQFail
; The IRQ handler returns to here
; and we check r4 was incremented
IRQok
CMP r4, #1
BNE IRQFail2
and IRQ_Handler is defined as:
;-------------------------------------------------------------------------------
; Exception Handlers
;-------------------------------------------------------------------------------
IRQ_Handler
ADD r4, r4, #1
; Clear the IRQ
MOV r5, #0x0
CS_WRITE CTI1, 0xee8, r5
LDR LR, =IRQok
MOVS PC, LR
This post has been edited by joshaw: 13 July 2010 - 01:12 AM














