Wednesday 13 July 2011

Observations on the ATtiny44

Back here, where I discussed Arduino IDE support for the ATtiny core, I mentioned that I didn't think the -44 was properly supported (although I'd had success with the -84); since then I've confirmed this.

I became sure that the source of the problem was just the various switches passed by the IDE to the native compiler and linker after a day's fiddling with them (you can inspect them by starting the IDE from a shell) and soon afterwards, rather than writing one of my own, I discovered Martin Oldfield's excellent Makefile.

In order to use it, I had to tweak it a bit (you can find my version here), principally to produce, and link against, an Arduino core library; Martin's version links all of the objects into the final image which made it too big for the -44.

One last -44 hint: never use floating-point mathematics: since none of the AT chips has a floating point unit, gcc has to insert software floating-point operations which are not cheap! They add about 1.5kB to the final image, leaving very little space for your precious program!