Thursday, May 7, 2015

Attiny Compiler bug

As you will now by now I am a big fan of the Attiny85 microprocessor. It is small but has a lot off features. It works standard without an external crystal at 8Mhz. It has 5 i/o pins that can be used for digital i/o or analogue i/o and can be programmed using the Arduino IDE. So I use Attiny's a lot in my projects.

However I have frequently been bursting into a compile error. And that is annoying. Some of my projects just wouldn't compile. And I new the code was OK. I recompiled for an Atmega 328 and the Arduino IDE did not complain. However when I compiled anew for the Attiny 85 I got this:
In many situations like this most of the time I let it rest and start another project. But it kept nagging me. And last weekend I revisited this project and started to get it working again. The same problem occurred.

So I visited the excellent MIT HIGH-LOW pages that made the Arduino IDE suitable for the Attiny85. And there was a new version of the compiler code for the Attiny85 available.



As you can see it is only compatible with the new Arduino 1.6 IDE.
So I tought why not. And I installed the new IDE. And guess what.........

Problem solved:


I yelled out some words my mother would not have approved off and afterwards cheered because my projects suddenly worked flawlessly.

So I wrote a mail to the MIT who developped the compiler. And within minutes I got a reply that said that they had altered the info on the webpage. And there it was:


The ATtiny’s work best with the newer, 1.6.x, versions of the Arduino software. 
You can also use the older, 1.0.x, versions of the software, but there may be some bugs. (For example, there’s one that prevents the use of programs greater than 4 KB.) Download the version of the ATtiny support that corresponds to the version of the Arduino software that you’re using.



There is a bug in the older 1.0.x version of the Arduino IDE that prevents compiling beyond 4k.
And they knew about it.........
What wonders me is why nobody had ever complained about it before. I know the use of the ATtiny85 is widespread,

So why didn't I upgrade before. Well most of the time I am reluctant to do that. Most updates bring a lot of overhead which is not needed and often slow your system down (we Windows users now that..........).

But sometimes...........

Till next time.
Have fun
Luc