jonloveslou:
Hey guys, first post, wondering if you could help me out?
Currently trying to develop applications for a TMS470R1A256 ARM processor using the IAR Kickstart compiler provided by TI.
Does anyone have any idea how to make an interrupt (a timer interrupt in this case) call a function when it occurs?
I’m used to assigning vectors and branching, in a startup file, to the function required. This processor (or compiler) doesn’t seem to function like that.
Like the title suggests, I am a newbie, only just started out, so go easy please if this is a stupid question or I don’t sound like I know what I’m talking about.
Jon
In my case, I do something like this in ARM assembler in the startup code to call a C procedure from an interrupt. AFAIK, there should be no compiler dependencies doing it this way as long as the linker can provide the address of the C procedure? However, this assembler syntax is specific to the ARM assembler. This handler is jumped to from the IRQ vector in the vector table starting at address zero.
;***********************************************************
IMPORT C_PROC ; Name of C procedure to call
IRQ_Handler ; Handler Label
SUB LR, LR, #4 ; Adjust for correct return
STMFD SP!,{R0-R3,LR} ; Save some registers
BL C_PROC ; Call the C procedure
LDMFD SP!,{R0-R3,PC}^ ;Pop and Return from Int.
;************************************************************
–Dave