Attach Interrupt to pins other then pin2 and pin3


I would like to know if there si a way to attach an external interrupt to other pins then pin 2 and pin 3, if yes, how?

I'm using the code from:

but i need the Atmega to wake up, when pin 13 goes high. I tryed to set "wakePin = 13;" but that did not help.

I (might) have found the "problem" in the "void sleepNow()" funktion

attachInterrupt(0,wakeUpNow, LOW) and detachInterrupt(0);

as far as I can read the "0" refers to pin 2, I could change it to "1" (pin 3), but on the PCB i made I'm using both of those pins as data pins for a display.

If I knew that I would run in to this problem I would have changed the PCB-layout, but now i'm thinking it is easyer to change it in the software.

Can it be done?



You may be able to use a "pin change" interrupt. Unfortunately, the Arduino libraries do not provide any wrappers for them. Search the forum for "pin change interrupt". If you cannot find what you need, report back and hopefully someone can get you on track.

Thanks for the keyword to search for found this:

i put:
PCICR |= (1 << PCIE0);
PCMSK0 |= (1 << PCINT5);

in the void setup();

and now when pin 13 goes high the thing wakes up!!


Excellent! Thanks for following-up.