Burning the Dwenguino Bootloader with another board

The Dwenguino comes with its own Dwenguino bootloader which makes it accessible from the Arduino IDE software. Please refer to the Dwengo GitHub repository for its source code. Although this bootloader is preburned on the dwenguino, this tutorial describes the different possibilities to burn the bootloader yourself.


Using an Arduino Uno

A. Prepare the arduino Uno

  1. Make sure you installed the arduino IDE 1.6 with the latest version of the dwenguino lib as explained in the Getting acquainted tutorial
  2. Open the Arduino IDE
  3. Connect the Arduino Uno to the computer
  4. Open the ArduinoISP example sketch: menu File > Examples > ArduinoISP
  5. Select the Arduino Uno board in menu Tools > Board > Arduino Uno
  6. Select the connected arduino in menu Tools > Port > COM[x] (Arduino Uno)
  7. Upload the ArduinoISP sketch

B. Connect the Dwenguino to the arduino Uno

Make the following connections from the output connector on the Arduino Uno to the Dwenguino: on the dwenguino you can either use the expansion connector, the ICSP connector on the expansion board or the ICSP connector beneath the LCD display.

Function From pin on Arduino Uno To pin on Dwenguino To pin on ICSP of Dwenguino
GND GND - Pin 6
VCC / 5V 5V + Pin 2
Reset D10 RST Pin 5
MOSI D11 D2 Pin 4
MISO D12 D12 Pin 1
SCK D13 D13 Pin 3

Connection Overview: arduino with dwenguino

C. Burn the bootloader

  1. Go back to the Arduino IDE
  2. Select the Dwenguino board: Tools > Board > Dwenguino
  3. Select the Arduino as programmer: Tools > Programmer > Arduino as ISP
  4. Burn the bootloader: Tools > Burn Bootloader (This can take about 2 minutes)

This process is successful if you can see a welcome message on the LCD screen and the leds are blinking

D. Start using Dwenguino

  1. Disconnect all wires to the Arduino.
  2. Connect the Dwenguino directly to your computer with the USB cable
  3. Select the Dwenguino in the ports menu: Tools > Port > COM[x] (Dwenguino)
  4. Start coding and upload new sketches

Using another Dwenguino board

You can follow exact the same procedure as above, but note the following small changes:

  • Step A: replace everywhere Arduino Uno by Dwenguino
  • Step B: make the same connections from the programming dwenguino (connected to your computer) to the dwenguino being programmed, but notice the MOSI pin on the dwenguino is at D2
  • Step C en D are unaltered
Function From pin on Dwenguino To pin on Dwenguino To pin on ICSP of Dwenguino
GND - - Pin 6
VCC / 5V + + Pin 2
Reset D10 RST Pin 5
MOSI D2 D2 Pin 4
MISO D12 D12 Pin 1
SCK D13 D13 Pin 3

Dwenguino bootloader

Using an AVR programmer

The Dwenguino bootloader can be burned to the Dwenguino through Arduino IDE with a programmer such as the AVR ISP II or on the command line by avrdude. The firmware can be find in the Dwenguino library under the folder ´/hardware/Dwenguino/avr/bootloaders/dwenguino´. To program the Dwenguino board run the following commands in the command line:

avrdude -p usb646 -c avrisp2 -P usb -e
avrdude -p usb646 -c avrisp2 -P usb -U lfuse:w:0xff:m -U hfuse:w:0xda:m -U efuse:w:0xfb:m
avrdude -p usb646 -c avrisp2 -P usb -U flash:w:"Caterina-Dwenguino.hex"