My Arduino Mega works fine on interrupts 0,1 (pin 2,3) and 5,4 (pin18,19).
Interrupt 2,3 (pin 20,21) however does not work, using exactly the same code and hardware.
I'm using Arduino 0017 software.
Anyone else experienced this? Maybe there is a solution?
Thanks in advance,
T.
Comment:
Apparently pin 20 and 21 on the Mega are slightly different than the rest of the interrupt pins.
They need the internal pullup resistors turned on - will not work with external pulldowns like the others.
Can you clarify? Which interrupt state are you looking for? LOW/RISING/FALLING/CHANGE? How were the external resistors connected and how big were they?
Clarification:
I have 3 rotary encoders connected each to 2 of the 6 interrupts on the Arduino Mega.
Normally I always use 10KOhm pulldown (from input to ground) resistors on all digital inputs.
And then in setup I don't use the digitalWrite HIGH lines.
In this case interrupts 0,1 and 4,5 worked fine for the CHANGE state.
2,3 did not - so I removed the resistors, connected the midpin to ground (instead of +5v) and reinserted the DigitalWrite HIGH lines.
Basically - used the encoder example as it is, instead of meddling with it. What I should have done from the beginning