Pages: [1]   Go Down
Author Topic: INT2 pin verboten? (Arduino core)  (Read 841 times)
0 Members and 1 Guest are viewing this topic.
Boston, MA
Offline Offline
Full Member
***
Karma: 0
Posts: 129
Batteries? We don't need no steenking batteries!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Continuing porting the Mosquino project (ATmega644pa) to the 1.0 core, I finally decided to chase down the INT2 pin issue that's been bothering me since 0022. Lo and behold... only INT0 and INT1 are handled, or even allowed, in WInterrupts.c.

In fact, it looks like somebody went to some length to remove all support for INT2 for the non-ginormous chips (e.g. #define EXTERNAL_NUM_INTERRUPTS 2 in wiring_private.h). Based on the trouble gone to, I assume this was done for some kind of important reason. Does anyone have a clue what that reason is/was?

E.g.:
Does use of the INT2 pin break horribly on some old Arduino board / AVR flavor (chip erratum) / avr-gcc version?
Was a lead developer hurting for a couple bytes Flash/RAM and decided 2 interrupts were enough?
Could it really have just been an oversight after all?

I have re-added it and it seems to work fine on my board, but I'm curious if I'm undoing someone's significant research and some bizarre issue will come to bite later.

Thanks!
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If the interrupt exists on the processor I see no reason to not use it.
Logged

Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 3
Posts: 843
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I use INT2 on my 1284P board and Arduino 1.0 without modifications. It seems to work fine.
Logged

Boston, MA
Offline Offline
Full Member
***
Karma: 0
Posts: 129
Batteries? We don't need no steenking batteries!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you using the version straight from the repository?

Based on your reply I just dug for it (to link to and show how the INT2 support has been removed since 0022)... only to find the Github version has it again! The repository version is almost byte-for-byte identical to what I re-wrote into the release version last night :-/ (downloaded a few days ago). Just how stale is the release version on the Arduino homepage, anyway?
Logged

Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 3
Posts: 843
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you using the version straight from the repository?

Based on your reply I just dug for it (to link to and show how the INT2 support has been removed since 0022)... only to find the Github version has it again! The repository version is almost byte-for-byte identical to what I re-wrote into the release version last night :-/ (downloaded a few days ago). Just how stale is the release version on the Arduino homepage, anyway?

Actually, you're right. I am using ManiacBug's 1284P distribution, so I don't know where he sourced it from and what changes he has made. So my comment is not relevant to Arduino 1.0 unmodified. Sorry about that.

Logged

Boston, MA
Offline Offline
Full Member
***
Karma: 0
Posts: 129
Batteries? We don't need no steenking batteries!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

...on further inspection, the current repository version is still missing support for detachInterrupt() on INT2. Neither will it detect the '644p/a as having a 3rd interrupt pin. Maybe I'll try submitting a patch?
Logged

Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 3
Posts: 843
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just had a look at the Winterrupts.c used in maniacbug's Mighty 1284 stuff, and INT2 is supported. So that's why I had no trouble with it. Prior to that I was using cores from ARV Developers from 022, but I don't think I tried to use INT2 yet.

I'm sure if you were to submit or publish a patch people would appreciate it. There are only so many hardware interrupts, its nice to be able to use them all.

Logged

Boston, MA
Offline Offline
Full Member
***
Karma: 0
Posts: 129
Batteries? We don't need no steenking batteries!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Problem description and updated files here :-) http://code.google.com/p/arduino/issues/detail?id=879
Logged

Pages: [1]   Go Up
Jump to: