🛠 Resusciter une Duemilanove sans bootloader : ICSP, fusibles et ATmegaBOOT
Objectives
The ATmegaBOOT bootloader (original STK500 protocol, 57600 bauds on 328 / 19200 on 168) can disappear: modified fuses, accidental erasure, failed flashing. The board then no longer responds to the IDE but is NOT dead: the 2×3 ICSP connector provides direct access to the chip. This tutorial is the complete resurrection procedure documented in the official "Programmer" tutorial: reading fuses, rewriting the correct bootloader HEX, verification.
Equipment
- 1 "bricked" Duemilanove (no port appearing when uploading, or permanent timeout)
- 1 ICSP programmer: AVR-ISP mkII, USBtinyISP (the classic cheap option), or another Arduino running ArduinoISP (see the programmer tutorial)
- 2×3 ICSP ribbon cable; USB cable
- Official HEX files:
bootloaders/atmega/folder in the ArduinoCore-avr repository (ATmegaBOOT_168_atmega328.hexfor a 328)
Complete code
# 1) Brancher le programmateur sur l'ICSP de la Duemilanove (respecter
# le sens du nappe : pin 1 = marque rouge, vers le RESET).
# 2) Lire les fusibles (USBtinyISP via avrisp ; 19200 est le debit ISP)
# Attendu pour ATmega328 : low=0xFF high=0xDA extended=0xFD
avrdude -c usbtiny -p m328p -U lfuse:r:-:h -U hfuse:r:-:h -U efuse:r:-:h
# 3) Si les fusibles sont hors spec (ex. high=0xC9 : RESET coupe !),
# les reprogrammer :
avrdude -c usbtiny -p m328p -U lfuse:w:0xFF:m -U hfuse:w:0xDA:m -U efuse:w:0xFD:m
# 4) Recrire le bootloader officiel (HEX du core, 2 Ko en fin de flash)
avrdude -c usbtiny -p m328p -U flash:w:ATmegaBOOT_168_atmega328.hex:i
# 5) Verifier la signature puis tester par le bootloader :
avrdude -c usbtiny -p m328p -n # "Reading | ####... signature 0x1E950F"
# IDE : carte "Duemilanove or Diecimila / ATmega328" + Blink -> doit repasser
# Variante 168 : -p m168, fusibles high=0xDD extended=0xF8,
# HEX ATmegaBOOT_168.hex, upload a 19200 bauds.
Expected verification
Reading the fuses returns low=0xFF, high=0xDA, extended=0xFD (328) — high=0xDD/extended=0xF8 for a 168. The signature read is 0x1E950F (328) or 0x1E940B (168). After rewriting the HEX, the test Blink sketch uploads normally via USB at 57600 bauds: the bootloader is alive. The TX LED blinks when the port opens.
Common errors
- ICSP ribbon cable reversed: avrdude responds "device not responding" or reads 0x000000/0xFFFFFF; the red wire (pin 1) must go to the RESET side — on the Duemilanove, the orientation of the 2×3 connector differs depending on revisions, check with a multimeter.
- Selecting the wrong chip in avrdude:
-p m328pon a 168 writes incompatible fuses; the signature read (0x1E940B vs 0x1E950F) settles the question. - Mixing up the two speeds: the bootloader communicates at 57600 (328) but ISP programming is done at the programmer's own speed — do not put
-b 57600on a-c usbtinycommand. - Leaving the programmer connected during a USB upload: the RESET signal is pulled from both sides, the upload fails.
- Overwriting the bootloader with a sketch HEX: after a
-U flash:w:mysketch.hexwithout a bootloader, the board can no longer be reprogrammed via USB — reflash the bootloader before testing the IDE. - Powering the target with 5 V from the programmer AND from the Duemilanove's USB simultaneously: generally acceptable (same rail) but a source of conflicts with some clones — power from a single source.
- Confusing this case with the polyfuse: a "dead" board that doesn't even light its ON LED is often a tripped 500 mA resettable fuse (short circuit on the 5 V) — unplug everything, wait, replug before attempting ICSP.
Other tutorials for this board
- Faire clignoter la LED 13 d'une Duemilanove (et choisir le bon ATmega)
- Bouton poussoir et moniteur série sur la Duemilanove (avec ses 0,5 s de silence)
- Potentiomètre et variation LED : l'ADC 10 bits et le PWM 8 bits version AVR
- Ajouter un deuxième port série avec SoftwareSerial (GPS sur broches 10/11)
- Régler la référence de mesure avec AREF et analogReference
- Persister une calibration dans l'EEPROM de l'ATmega (512 octets ou 1 Ko)
Code examples for this board
clignotante.inoArduinobouton-led.inoArduinopwm-respiration.inoArduinopotentiometre-plotter.inoArduinoservo-balayage.inoArduinobuzzer-melodie.inoArduino