Pages: [1]   Go Down
Author Topic: Is there a fix for the INT0/INT1 bug with Leonardo?  (Read 2476 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello dc509,

Me too tried to work with this interrupts.
As I found somewhere here in the internet  http://www.adafruit.com/blog/2012/06/03/arduino-leonardo-pinout-reference/ ...
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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Germany
Offline Offline
Full Member
***
Karma: 10
Posts: 230
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 - downloaded 75 times.)
* wiring_private.h (1.84 KB - downloaded 52 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Germany
Offline Offline
Full Member
***
Karma: 10
Posts: 230
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Code:
arduino-1.0.1\hardware\arduino\cores\arduino

And now when you restart it, it works.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Jump to: