Pages: [1]   Go Down
Author Topic: External interrupts broken after 0022 upgrade  (Read 754 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

Hi,
I have a custom Arduino board design using an ATmega644PA and an external realtime clock with its alarm interrupt pin tied to INT2. As of Arduino core 0020, a simple test sketch, which sets an alarm for a few seconds into the future and puts the CPU to sleep, awakens to the falling edge of INT2 as expected. But after updating to the 'cores' files (wprogram.h, etc.) that have changed between 0020 and 0022, the same sketch no longer awakens/responds to INT2 (maybe others, but this is the only one I have tested so far). Replacing WInterrupts.c with the old version restores normal operation, but this doesn't seem like an ideal solution going forward.

Looking at them side by side, it looks like there has been a major overhaul of this file between the two revisions, but I'm still pretty new to ATmega and the rationale behind the changes - let alone what they actually are doing differently under all those #ifdefs - is a bit over my head. Has anyone else had interrupt trouble under 0022? Is it known if ATmega644 is officially supported, or officially unsupported  (or neither) in this version?

Thanks!
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Has anyone else had interrupt trouble under 0022? Is it known if ATmega644 is officially supported, or officially unsupported  (or neither) in this version?

The standard 'official' Arduino IDE distrubution has never supported the 644 or 644P chips. One company called Sanguino sells a 644P board and they provided the modified IDE core files needed for the IDE to support their 644P board ( http://sanguino.cc/ ) .

However their web site only shows modified files working with IDE version 18, so I can't answer if those files work with version 22 or not. You could probably email them and ask if their modified files supports IDE 22 or not, and if not if they are planning on updating their modified files.

Lefty
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

Sanguino is where I got the files originally, but it looks like they have not synced with the official Arduino core in some time. On the other hand, I don't think they made (or needed to make) any core changes, other than the obvious ones in pins_arduino.c/.h. Until 0022 syncing my project to the official core has gone off without a hitch :-)

Quote
The standard 'official' Arduino IDE distrubution has never supported the 644 or 644P chips.

I'm not so sure about this, although any *official* '644 support is pretty new (0022?). I did a little more digging and found these threads:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1281994270/19#19
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1284589704

Assuming "Mark S" in the forum is the Mark Sproul whose changes appear in the overhauled files, it sounds like he's busting butt to improve support for more chips (the changes are aimed at cross-chip compatibility), and ATmega644/p at least is on that list. Unfortunately the "http://www.arduino-avr.com/" he mentions has disappeared down the rabbit hole (not even in wayback/google cache!); I assume there was some documentation there on which chips were supported/tested and more about the changes on an architectural level.

AFAICT use of a '644 for Arduino is pretty uncommon apart from Sanguino, so this may be one of those "patches welcome" problems, but I am hoping someone someone else has also encountered this and has a better idea what is going on in there :-)
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 524
Posts: 26473
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There is this link
http://www.avr-developers.com/corefiles/index.html
That shows support thru -0020.

I used the sanguino files (unzipping & moving & stuff & modding boards.txt) to down to a '644 using an UNO for power & USB access, running IDE -0021.
I built this board for skyjumper, he downloaded and ran sketches with IDE -0022.
Neither of us tried INT2 tho as far as I know, but that is one of the changes we are  making next.

Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: