Teensy++ 2 PCINTn interrupts

Status
Not open for further replies.

el_supremo

Well-known member
Although the T++2 hardware has pin change interrupts on all pins on Port B, none of them are accessible in Teensyduino. The code only handles the INTn interrupts.
I need a couple of pin change interrupts (FALLING) which can wake up the processor from a power down sleep but INT4-7 can only do that with a level interupt (LOW). INT0 and INT1 are used by the I2C interface and INT2 and INT3 are used by the serial port, both of which are in use.
Is there some way that I can set up pin change interrupts on, say, pins 26 and 27?

Pete
 
The best example is in the SoftwareSerial library. It uses the pin change interrupts and supports Teensy++ 2.0 (and all other AVR boards) using some hardware abstraction macros I contributed to Mikal Hart, which eventually found their way into the official Arduino core.

You can probably just lift the code right out of SoftwareSerial to get this working.
 
Thanks very much Paul for pointing me in the right direction. I was over-thinking the problem as usual :)

Pete
 
Status
Not open for further replies.
Back
Top