Does anyone know how to configure the Atmega32u4 to run using an external 8MHz oscillator ?
I needs to still be responsive to the Arduino IDE
Thanks
Does anyone know how to configure the Atmega32u4 to run using an external 8MHz oscillator ?
I needs to still be responsive to the Arduino IDE
Thanks
See §28.2 in Atmel-7766-8-bit-AVR-ATmega16U4-32U4_Datasheet.pdf, which explains usage of various fuse bits.
Also see engbedded.com/fusecalc, which lets you easily figure out fuse settings. Fusecalc also tells you the strings to use as part of avrdude command strings.
Once you know the fuse settings, send them to your device via a command like
avrdude -p m32u4 -c usbasp -u -U lfuse:w:0xEF:m -U hfuse:w:0xD5:m -U efuse:w:0x07:m
or like
avrdude -p m32u4 -P $port -c arduino -u -U lfuse:w:0xEF:m -U hfuse:w:0xD5:m -U efuse:w:0x07:m
where $port
represents a port name like /dev/ttyUSB0
.
Note, it makes sense to read the fuses first, and put the readings into Fusecalc to see what they correspond to. You can read the fuses via a command like
avrdude -p m32u4 -P $port -c arduino -U hfuse:r:-:i
millis()
reports correctly, that is controlled by correctly setting the .build.f_cpu
parameter in the appropriate boards.txt section.
– James Waldby - jwpat7
Nov 13 '16 at 19:30