Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

How to define 2 IRQs

2005-03-17 by tphatrapornnant

Hi all,

I have an IRQ problem. My program did not jump after interrupt 
occured. Now I'm using 2 IRQs (I don't want to use FIQ) and I assign 
IRQ 0 for Timer1 and IRQ 1 for Timer0.

VICIntSelect = 0

For Timer1:

VICIntEnable |= 0x00000020;
VICVectAddr = (unsigned long)Func_A;
VICVectCntl0 = 0x25;

For Timer0:

VICVectAddr = (unsigned long)Func_B;
VICVectCntl0 = 0x24;
VICIntEnable |= 0x00000010; 

In simulator, the addresses of Func_A and Func_B were loaded in 
vector table properly. But when interrupt occured (RawInt = 1), the 
program didn't jump to those function. I think my Startup.s is not 
correct. I don't know how to define addresses of 2 function for IRQs.

-------------------------------------------
Vectors:        LDR     PC, Reset_Addr         
                LDR     PC, Undef_Addr
                LDR     PC, SWI_Addr
                LDR     PC, PAbt_Addr
                LDR     PC, DAbt_Addr
                NOP                            /* Reserved Vector */
                LDR     PC, IRQ_Addr
                LDR     PC, FIQ_Addr

Reset_Addr:     .word   Reset_Handler
Undef_Addr:     .word   Undef_Handler
SWI_Addr:       .word   SWI_Handler
PAbt_Addr:      .word   PAbt_Handler
DAbt_Addr:      .word   DAbt_Handler
                .word   0                      /* Reserved Address */
IRQ_Addr:       .word   IRQ_Handler
FIQ_Addr:       .word   FIQ_Handler

Undef_Handler:  B       Undef_Handler
SWI_Handler:    B       SWI_Handler
PAbt_Handler:   B       PAbt_Handler
DAbt_Handler:   B       DAbt_Handler
IRQ_Handler:    B       IRQ_Handler  /* ?????????? */
FIQ_Handler:    B       FIQ_Handler

------------------------------------------------

It seems program always jump to IRQ_Handler address. If I assign 
Func_A to IRQ_Handler

IRQ_Handler:    B       Func_B

Program will jump to Func_B when interrupt occurs. I used to hook 
these 2 function with FIQ and IRQ Handler. It worked well. But for 2 
IRQs, I don't know how to define them.


Does anyone know can help me?

Thanks,

Teera.

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.