damellis / attiny

ATtiny microcontroller support for the Arduino IDE
718 stars 224 forks source link

Clock Frequency does not get set #111

Closed sonyhome closed 7 years ago

sonyhome commented 7 years ago

With brand new installations of:

I noticed the chip's frequency does not actually get set.

To demonstrate I used an APA-102 LED strip with timed sequences and depending on the frequency they go faster or slower to the said ratio, instead of being the same speed. This explains why my bombproof demos were not working.

I'm going to investigate but if I recall this library is just a set of definitions, so the issue might be in the IDE.

sonyhome commented 7 years ago

OK I'm an idiot. I remember now that the Arduino IDE does not actually reprogram the fuses of the chip, so whatever you choose on the IDE does not actually change the chip frequency. You just have to match the IDE choice to what the chip fuses are set to.

To set the fuses for AtTiny85: https://dntruong.wordpress.com/2015/07/08/setting-and-reading-attiny85-fuses/

I'm gonna close this ticket if I can.

damellis commented 7 years ago

You can set the fuses using the "Burn Bootloader" command in the Arduino IDE. For this ATtiny core, there's no actual bootloader, but the command should still set the fuses.