Ive been playing around with an Atmel AT91SAM7S64 (ARM7TDMI) for a little bit. Gradually trying to learn the thing.
There are a number of pins that can be configured for IRQ.
My question is, is it possible to have a different ISR for each different pin OR do all IRQ fall under one ISR and within that ISR i have to determine which pin was triggered and go from there ?
If it IS possible, how would I go about doing it ? I dont need the code or anything, just like steps on what i have to do (ill figure out the rest on my own).
Ive been the most sucessful with Crossworks, but if you think another compiler might be easier to use, and or have better library support and just easier overall, let me know. I had a hard time getting my jlink to work with keil, and its still kind of iffy.
With the ARM7, you will need to work out which (GPIO) port generate the interrupt and branch to a handler for that port. Then you need to determine the pin that caused the interrupt and deal with it accordingly.
I assume you have a global interrupt handler with dispatcher in place ?
Ya, looks like you have one ISR for your GPIO port A and you need to figure out the pin.
I’ve just got to the point where I need to handle an edge interrupt myself. I can post code when I get it working for simple edge trigger and identifying the pin. I’ll work on this tonight.
With the ARM7, you will need to work out which (GPIO) port generate the interrupt and branch to a handler for that port. Then you need to determine the pin that caused the interrupt and deal with it accordingly.
So what you are saying is that any GPIO interrupt (whether Pin1 or Pin25) interrupt, it will go to only ONE handler (the irq handler) and from there i have to determine WHICH pin interrupted and then do whatever it is I need to do ?
I cant have a handler for Pin1 and Pin25 right ?[/quote]
If you download the sample code from Atmel, they have a pio_it.c file with an interrupt handler library in it. I always hate these libraries as the style seems crazy, but it does a decent job of outlining everything needed. It handles multiple handlers by having a ‘table of handlers’ and having a main handler that figures out what’s going on, and calling the correct sub-handler.