Is there a fix for the INT0/INT1 bug with Leonardo?

On the Leonardo, for pin interrupts, INT0 works on pin 3 instead of pin 2. INT1 does not work at all. INT2&3 do not appear to work either. I have found that this a known problem, apparently in WInterrupts.c, but cannot find a fix. Is there one? Or a workaround that makes an interrupt work on pin 2?

Hello dc509,

Me too tried to work with this interrupts.
As I found somewhere here in the internet Arduino Leonardo Pinout Reference « Adafruit Industries – Makers, hackers, artists, designers and engineers! ...
INT0 works on PIN 3, and INT1 works on PIN 2.
But - as you - I couldn't get the INT2 and 3 - (nor on the other Pins as you can see in the picuture...).

Because I use the iTead Dual Stepp Motor Shield (V1) - I'm not can not work with interrupts anymore (because this two PINS are blocked - ok, I could cut some Pins on the shield and solder them to an other the board...)

Is there no wire between the CPU and the pins, or - if we would know how to configure the Leonardo - coul'd get the interrupts 2 and 3 on the previewed PINS?

By
Thomas

Thomas
Thanks for the link - very useful. Have tried all 4 pins and only INT0 works, and on pin 3 as depicted in the graphic. INT1 on pin 2 does not seem to work at all (same for INT2/3) and I have found references elsewhere which indicate that this is an omission in the source code for the Leonardo, which implies it could be fixed. Unfortunately, cannot find out how to perform the fix and am not familiar with the lower-level stuff yet to know where to start.

Regards

Duncan

dc509:
Thomas
Thanks for the link - very useful. Have tried all 4 pins and only INT0 works, and on pin 3 as depicted in the graphic. INT1 on pin 2 does not seem to work at all (same for INT2/3) and I have found references elsewhere which indicate that this is an omission in the source code for the Leonardo, which implies it could be fixed. Unfortunately, cannot find out how to perform the fix and am not familiar with the lower-level stuff yet to know where to start.

Regards

Duncan

Hi Duncan,

I have make a fix for this. These attached files are for the IDE 1.0.1. I have pushed the Interrupts in the "right" order,
-Interrupt Number 0 works on Pin 0
-Interrupt Number 1 works on Pin 1
-Interrupt Number 2 works on Pin 2
-Interrupt Number 3 works on Pin 3
and new
-Interrupt Number 4 works on Pin 7

For me it works.

Have fun with it.

Markus

WInterrupts.c (8.91 KB)

wiring_private.h (1.84 KB)

Hello Markus,

INT0 and INT1 are working fine on D0 and D1
My sketch is using and I2C interface (now on D2 and D3 on the Leornardo). I noticed that when I setup INT0 and INT1 ("attachInterrupt") I2C is no more working.
I don't use INT2 and INT3, as now possible with your modifications.

Would it be possible to advice me how to fix this issues ?
Many thanks,

Jean-Luc

jlkieny:
Hello Markus,

INT0 and INT1 are working fine on D0 and D1
My sketch is using and I2C interface (now on D2 and D3 on the Leornardo). I noticed that when I setup INT0 and INT1 ("attachInterrupt") I2C is no more working.
I don't use INT2 and INT3, as now possible with your modifications.

Would it be possible to advice me how to fix this issues ?
Many thanks,

Jean-Luc

Yes of course,

if I understand you right, you need the place where the files should be, close the IDE, copy these files in this folder and overwrite the old one's

arduino-1.0.1\hardware\arduino\cores\arduino

And now when you restart it, it works.

Thanks Markus for the quick reply.

i copied the files in the right folder, but in between I found an error in the my code and was able to fix it.
Everything is now working fine. Your modifications and extensions are really helpful.

Grüsse
Jean-Luc