Created
June 23, 2011 14:05
-
-
Save nedos/1042593 to your computer and use it in GitHub Desktop.
Flash a 'virgin' ATMEGA328PU with the Arduino Bootloader. On MacOS simply brew install avrdude --with-usb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
OPTS="-p m328p -c avrisp2 -P usb" | |
PWD="$(pwd)" | |
# Unlock the chip | |
avrdude $OPTS -U lock:w:0x3f:m | |
# Set the Fuses | |
avrdude $OPTS -e -U lfuse:w:0xff:m -U hfuse:w:0xda:m -U efuse:w:0x05:m | |
cd ~/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/bootloaders/atmega | |
pwd | |
# Write the Bootloader | |
avrdude $OPTS -e -U flash:w:ATmegaBOOT_168_atmega328.hex:i | |
# Lock the chip | |
avrdude $OPTS -e -U lock:w:0x0f:m | |
cd $PWD | |
pwd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment