🛠 Faire clignoter la LED 13 d'une Duemilanove (et choisir le bon ATmega)
Objectives
Get started with the Arduino Duemilanove (2009), the last major "old-school" board before the Uno: an 8-bit AVR ATmega168 or ATmega328 running at 16 MHz, 5 V logic, FTDI FT232RL USB-to-serial bridge, and ATmegaBOOT bootloader. The first program is a classic — blinking the LED on pin 13 — but it hides THE historical pitfall of this board: there are two different chips behind the same board name, and you must select the correct one in the IDE.
Hardware
- 1 Arduino Duemilanove board with ATmega328 (or ATmega168 — check the silkscreen on the DIP-28 chip)
- 1 mini-USB cable (Duemilanove boards use a mini connector, not micro)
- PC: on Windows, install the FTDI VCP driver (modern Windows 10/11 drivers usually include it)
- Arduino IDE with the "Arduino AVR Boards" core
Full code
// Blink Duemilanove — LED integree broche 13 (HIGH = allumee)
const byte LED = 13;
void setup {
pinMode(LED, OUTPUT);
}
void loop {
digitalWrite(LED, HIGH); // LED allumee
delay(1000);
digitalWrite(LED, LOW); // LED eteinte
delay(1000);
}
In the IDE: Tools > Board > Arduino Duemilanove or Diecimila, then Tools > Processor: select "ATmega328" if your chip is a 328 (or 328P), or "ATmega168" if it is a 168. Select the serial port (the FTDI USB-to-serial port, never a Bluetooth port) and Upload.
Expected verification
The "L" LED blinks once per second as soon as the upload finishes. The board's TX/RX LEDs blink during the upload (USB traffic via the FTDI chip). The program continues to run without USB, powered by a 7–12 V jack supply or a battery connected to the Vin/GND pins on the POWER connector.
Common errors
- Wrong processor selected: a sketch compiled for the 328 (57600 baud, 30720 bytes) uploaded to a 168 (19200 baud, 14336 bytes) fails with a bootloader timeout — and vice versa. This is THE Duemilanove pitfall: the board has the same name but there are two chips.
- Missing FTDI driver on Windows: no COM port appears; install the FTDI VCP driver (clones with counterfeit FT232R chips may refuse to enumerate after certain driver updates).
- Charge-only USB cable: the power LED lights up but no port appears.
- Confusing the power LED (ON, steady) with the user "L" LED (pin 13).
- Too weak a jack supply: below 7 V the 5 V rail becomes unstable, above 12 V the regulator overheats — the Duemilanove is strict about the recommended 7–12 V range.
Other tutorials for this board
- 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)
- Convertir la Duemilanove en programmateur AVR (ArduinoISP) pour graver des puces nues
Code examples for this board
clignotante.inoArduinobouton-led.inoArduinopwm-respiration.inoArduinopotentiometre-plotter.inoArduinoservo-balayage.inoArduinobuzzer-melodie.inoArduino