INT2 attachInterrupt support

An advanced Arduino-compatible board with ATmega1284P and ATmega32u2 MCUs for experienced users. More RAM than a Mega, but in a convenient Uno-style form factor. [Product page]
Post Reply
Joined:Thu Aug 29, 2013 3:32 pm
INT2 attachInterrupt support

Post by vicatcu » Wed Sep 04, 2013 7:02 pm

Hi Guys, am I correct that some updates to WInterrupts.c are needed in the core to properly support the attachInterrupt Arduino API so that DIG8 can be used for it's INT2 function in sketches?

On a sidenote, is there any plan to put the Goldilocks core up on Git-Hub so that users like me can directly contribute back?

Joined:Fri Jul 19, 2013 6:17 am

Re: INT2 attachInterrupt support

Post by feilipu » Sat Sep 07, 2013 4:42 am

Hi Vic,

actually there isn't a Goldilocks core as such. The support for 1284p in the standard core is now pretty good. Some others have done a lot of work to improve the situation. So we thought to make it simple and more compatible we'd not go down the path of building a special core.

However, there are still two issues that could benefit.

First, the delay calculation in arduino predicates 8MHz or 16MHz clocks. This is discussed in the forum. Kind of silly to do this, but that's what they've done. Jon noticed this earlier, but we didn't change it. The easy option is just to use the avr-libc delay tools like _delay_ms() which calculate properly based on FCPU. But it would be great if the arduino core could just do the right thing with various system clocks.

Second, there are a lot of features in 1284p that aren't available on the 328p, which could go into the core too. You mentioned the INT2, as one. I'm also keen to have the additional timers and RTC functions there too. There are some 1284p supporters on who might like to get involved too (like Stewie).

I'm sure that the avr-libc team are going to release their time.h stuff into general release on the next major drop, so that capability combined with a Timer2 sys_tick() makes for a great result.

If you want to start a thread on this forum for a building a special Goldilocks core, I'm sure that Freetronics would open this up the goldilocks github repository to you. I'm not the best person to initiate this as my arduino-fu is not strong.

Post Reply