Pages: [1]   Go Down
Author Topic: Interrupt Handler Names on Due  (Read 932 times)
0 Members and 1 Guest are viewing this topic.
Austin, Texas, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello all,

It's my understanding that on the AVR board you do something like the following to set up an interrupt handler.

Code:
IRS(vector)

Where vector is the name of the interrupt vector you want to handle.

How is this done on the Arduino due?

All I can find is a file called "interrupt_sam_nvic.h" located at:
arduino-1.5.2-windows\arduino-1.5.2\hardware\arduino\sam\system\libsam\include

In here there is a comment which states

Code:
* For NVIC the interrupt vectors are put in vector table. So nothing
 * to do to initialize them, except defined the vector function with
 * right name.

My question is, what is this "right name?" where are they defined, and do I simply do the following?

Code:
ISR(right name)

assuming I have the right name?

Thanks
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It depends, what are you trying to do an interrupt for?  If you just want an interrupt on one of the pins, use attachInterrupt(pin, function_name) and detachInterrupt(pin).

The Due supports arbitrary interrupts on all pins...you are not limited to 2 or 3 or 4 (or whatever the Uno has.)

If you are talking about timers that's substantially different and more complicated and has been discussed extensively here:

http://forum.arduino.cc/index.php?topic=130423.0
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 173
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It depends, what are you trying to do an interrupt for?  If you just want an interrupt on one of the pins, use attachInterrupt(pin, function_name) and detachInterrupt(pin).

The Due supports arbitrary interrupts on all pins...you are not limited to 2 or 3 or 4 (or whatever the Uno has.)


The Uno also supports interrupts on more than 3 pins. The limiting factor on the Uno is that you still only have 3 interrupt vectors.
The user still needs to figure out which pin was interrupted.
This library makes it easier, but possibly at the cost of response time.
http://playground.arduino.cc/Main/PinChangeInt
Logged

Pages: [1]   Go Up
Jump to: