damellis / attiny

ATtiny microcontroller support for the Arduino IDE
720 stars 226 forks source link

ATtinyX4 external clock fuse bits wrong? #107

Closed merenyil closed 8 years ago

merenyil commented 8 years ago

In "boards.txt" file, the fuse setting is the following for the external clock cases:

"ATtinyX4.menu.clock.external8.bootloader.low_fuses=0xfe"

For ATtiny x4, the lower 4 bits (CLKSEL0...CLKSEL3) of "Fuse low byte" define the clock source, according to page 161 in Atmel's manual Rev. 8006K-AVR-10/10.

The "0xfe" value sets "0111" bits for CLKSEL0...CLKSEL3, however this config is stated as "Reserved" according to page 25. The external clock setting is "0000" according to the manual.

So, I think the right setting should be: "ATtinyX4.menu.clock.external8.bootloader.low_fuses=0xf0"

damellis commented 8 years ago

I think you've got the bits backwards. We're setting CKSEL3:0 to 0111 (0xE) for Crystal Oscillator / Ceramic Resonator.