Skip to content

Instantly share code, notes, and snippets.

@toolness
Created March 27, 2017 01:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toolness/5c42842a1793b792538c20e9003c93e1 to your computer and use it in GitHub Desktop.
Save toolness/5c42842a1793b792538c20e9003c93e1 to your computer and use it in GitHub Desktop.
Fuse notes for the ATMega328p

I purchased three Amtel ATMega328p MCUs from Amazon. The product was advertised as coming "w/ Arduino UNO Bootloader", which I thought nothing of because I was going to overwrite the bootloader with my own programs.

However, I did not anticipate the fact that these units would actually come with their fuses set to the Arduino UNO defaults: most notably, they configured the unit to be driven by an external clock, which disabled the chip's internal 1 Mhz oscillator. This made it impossible to communicate with the chip via avrdude, as the chip was eternally waiting for an external clock to drive it.

Fortunately, after much searching and experimentation, I found a modified ArduinoISP script by a david.prentice that modified the default ArduinoISP to emit a slow clock signal on the Arduino's digital pin #3. Once I connected this to my MCU's XTAL1 clock input, avrdude was able to communicate with it.

I used the Engbedded fuse calculator to find the default fuses for the chip and configure them via avrdude on my system:

avrdude -F -V -c avrisp -p atmega328p -P /dev/ttyACM0 -b 19200 -U lfuse:w:0x62:m -U hfuse:w:0xd9:m -U efuse:w:0xff:m

This allowed me to remove the clock source from XTAL1 and use the chip's internal 1 Mhz oscillator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment