Hello,
I have GPIO interrupt questions (I'm using Teensy 3.1, Ubuntu 12.04, and switching between teensyduino (based on Arduino 1.05) and Eclipse Arduino IDE [EAI] (based on Juno and Arduino 1.5.5)
FYI-My need is to implement an ISR to respond to the falling or rising edge of a pulse. Also, at the moment I'm using pin 20 for PWM output and pin 14 for ADC input. I prefer to operate in EAI.
If there's a complete and upto source for this information please let me know, otherwise I ask for an explanation. I've read many many posts but for many it's hard to determine which teensy
they apply to and I've wasted enough time on useless tangents.
My questions:
1) From a Teensy 3.1 pinout point of view, which (GPIO) pins are available for use detecting this pulse using an interrupt? Or, at least a few candidates that are
likely NOT to interfere with other useful functions. If you want to suggest shifting my PWM and ADC pins around to accommodate a better arrangement plz do so.
2) How do I setup an interrupt ISR for the GPIO pin connected to my pulse?
a) How exactly is the isr function defined?
b) How do I enable interrupts for this behavior, i.e. for rising or falling?
c) How do I "attach" my isr function definition to the enabled interrupt?
d) Are there functions defined that I can use to enable/disable this interrupt at different times?
e) Any cautions about?
I know I have the option of working with registers directly to configure and control but if there's a usable operations for this I want to use them.
3) Can you provide an (complete, i.e. with includes) example?
I know I maybe going against the grain with Eclipse Arduino IDE, but being able to manage build, navigate through code, and better editing features is much less frustrating than Arduino IDE.
So if possible, I'd appreciate a note whether your advise is specific to teensyduino or whether it applies to Eclipse Arduino IDE.
Finally, I soon plan to use interrupts for ADC. If doing so has some not so obvious tricks compared to GPIO interrupts please offer that too.
Thanks in advance.
I have GPIO interrupt questions (I'm using Teensy 3.1, Ubuntu 12.04, and switching between teensyduino (based on Arduino 1.05) and Eclipse Arduino IDE [EAI] (based on Juno and Arduino 1.5.5)
FYI-My need is to implement an ISR to respond to the falling or rising edge of a pulse. Also, at the moment I'm using pin 20 for PWM output and pin 14 for ADC input. I prefer to operate in EAI.
If there's a complete and upto source for this information please let me know, otherwise I ask for an explanation. I've read many many posts but for many it's hard to determine which teensy
they apply to and I've wasted enough time on useless tangents.
My questions:
1) From a Teensy 3.1 pinout point of view, which (GPIO) pins are available for use detecting this pulse using an interrupt? Or, at least a few candidates that are
likely NOT to interfere with other useful functions. If you want to suggest shifting my PWM and ADC pins around to accommodate a better arrangement plz do so.
2) How do I setup an interrupt ISR for the GPIO pin connected to my pulse?
a) How exactly is the isr function defined?
b) How do I enable interrupts for this behavior, i.e. for rising or falling?
c) How do I "attach" my isr function definition to the enabled interrupt?
d) Are there functions defined that I can use to enable/disable this interrupt at different times?
e) Any cautions about?
I know I have the option of working with registers directly to configure and control but if there's a usable operations for this I want to use them.
3) Can you provide an (complete, i.e. with includes) example?
I know I maybe going against the grain with Eclipse Arduino IDE, but being able to manage build, navigate through code, and better editing features is much less frustrating than Arduino IDE.
So if possible, I'd appreciate a note whether your advise is specific to teensyduino or whether it applies to Eclipse Arduino IDE.
Finally, I soon plan to use interrupts for ADC. If doing so has some not so obvious tricks compared to GPIO interrupts please offer that too.
Thanks in advance.