Before this bites anyone else: with the 32U4 and using the Arduino IDE v1.0.5,

Before this bites anyone else: with the 32U4 and using the Arduino IDE v1.0.5, you get access to interrupt 4 which is on pin 1 of the package (or digital pin 7), giving you a total of 5 interrupts. However, using IDE v1.5.2, that interrupt is not available and you’re left with 4.

For me, this is a problem because interrupts 0, 1, 2, and 3 are on pins 3, 2, 0 and 1 respectively, which are the UART and I2C ports. So those automatically get reserved (by me.) Which leaves only interrupt 4 as a viable option.

For some reason the Arduino folks decided to not make it available with the bootloader that’s in the 1.5.2 IDE. There’s just so much limitations they impose, it’s ridiculous. Things they should be fixing is ignored forever, and stuff that works just fine, gets broken in subsequent version upgrades. So be warned, if you want 5 interrupts on the 32U4, stick with the v1.0.x version of the IDE.

I wonder what the ‘feature’ is they have added to cause this. Can only be a minor bug in a file somewhere.

@Adam_Sharp Looking at the interrupt c++ file between the two builds, it looks like they simply did not include support for INT.6. However, there may be a reason for it elsewhere, maybe they’re using it for something else, I don’t know. At this point I’m not inclined to go sift through their code to figure out where or why they left it out. Seems to work fine with 1.0.x, so I don’t understand why they took it out with 1.5.x …

I’ve been wondering what a gcc toolchain with a real editor and the gdb debugger would be like. I’m sure that after some difficulty, it would be relief to leave the Arduino IDE behind. My only question would be whether libraries like FASTLED would work properly in that configuration.

This is why I’m slowly moving away from the Arduino IDE, and using Atmel Studio instead. It gives me access to the entire AVR/ARM family as opposed to the select few that Arduino supports.

The bigger issue here is that 99% of all the libraries out there rely on the IDE, and how the Arduino core pulls in the necessary files. That’s not to say you can’t hack AS to do the same thing but at that point you’re back into using Arduino (messed up) data.

I know @Daniel_Garcia has been working on separating FastLED from the Arduino core and if I’m not mistaken there are only a file or two left that FastLED still relies on. I could be wrong, it’s been a few months since he last mentioned it.

I haven’t had a chance to do much more work with getting the library to build outside of arduino - I know a handful of people have gotten it building w/Atmel studio. I probably won’t revisit this until the summer some time.

For what it is, and the demographics they’re targeting, it works, and they’ve had success. However, with the more recent hardware releases, a) I don’t see a beginner picking one up, and b) those that do are seasoned users who are already having to cope with the limitations of the IDE and Arduino core. Unless they change that part, it will get stuck in a “beginner” stage unfortunately.

I switched to Studio some time ago. Once you get the switches correct, it works like a dream. But it is not a tool for the beginner or the faint hearted. If you write code for a living, it offers a much more comfortable environment.
There are now so many processors in the Arduino family, plus all the 3rd parties adding in stuff to the pot, it is loosing its way. It must be fantastically difficult to support. But it is getting to the point where it needs re-coding from the ground up. And that is a big undertaking.

Arduino could be a victim of its own success if the cracks get much bigger.

@Adam_Sharp What did you need to do to get FastLED compiling with Studio?

@Paul_Russo The first thing I had to do was take apart the make file from the Arduino IDE to work out all the switch settings for the various stages. And then compiled all the libraries into Studio libraries for each target processor I used, ready to link together from projects. This takes a huge amount of time and is prone to many issues, Since then I changed my approach.

However, there is now a installable module that appears very popular that emulates the Arduino IDE inside Studio. Personally, I have not tried it, but will give it a go on a new project when one comes along. This is called: “Arduino Ide for Atmel Studio 6.1 & 6,2”. Its free, like Studio. You need an account at Atmel to download Studio and its updates and add-ons, but there is no charge and they don’t appear to spam you.

Next rather than compiling the libraries for each processor, I maintained directories holding all the source code for libraries I used (either Arduino, third party or my own) and these were linked into projects to be compiled specifically. However, if a library was updated for whatever reason, the code for a project, when re-compiled would not produce the same programming code. Rubbish for revision control.

So I shifted to keeping the relevant libraries as sub-projects of each project. Thus if I go back to a project after 6 months and libraries have changed, I have the option of updating the sources or leaving them as they were when I originally compiled them. Makes the projects larger, but revision control is maintained. With the better dependancy handling in Studio, the compiling process is a breeze. Because once a library has been compiled, it rarely needs compiling again as I change the project code.

The biggest bind is actually downloading your compiled code to the target board. This has to be done outside of Studio (or with home made commands in the tools section) as Studio does not support the Arduino boot loader or AVRDude. I use many different programmers: including the Arduino boot loader, but also the Dragon AVR because it supports real time debugging and a couple of other programmers, including using Ethernet boot loaders (very useful for remote networked projects). I use Megunolink to supplement Studio and give me the download and serial interfaces that are missing from Studio. It also has a load of useful other stuff built in. One nice feature is it can watch the HEX file being updated by Studio and it will automatically download it for you, each time you re-compile.

Specifically for FastLED, once you have Studio producing Arduino code reliably. Then FastLED should not be a problem. There are two key points. First is to make sure the compiler version is the same as the one in the Arduino IDE. You can point Studio to use the Arduino version quite easily and then you know you are safe. I actually have a repository of AVR tools with loads of different versions that Studio can use on a project by project basis. This helps me with my revision control too, in case a tool is updated. The next key point is to ensure the compiler optimisation matches that of the Arduino IDE too. Otherwise all kinds of weird sh*t happens. Also FastLED does not compile for every processor supported by Studio, only a very small set, due to optimised code.

Hope this gives you some pointers. I’m not going to give step by step instructions. It would take for ever to write. If you get stuck, do shout.

The Arduino IDE for AS is just a bridge between AS and the Arduino IDE itself. It still use all of the Arduino core files, libraries, and everything as if you are using the actual IDE itself. You are still limited to what Arduino offers.