Showing posts with label USB. Show all posts
Showing posts with label USB. Show all posts

Saturday, May 7, 2011

Arduino Uno: Upload new firmware to the Atmega8U2

In the previous article it is described how to put Arduino Uno into DFU mode. To upload a new firmware the dfu-programmer is needed (Ubuntu users: sudo apt-get install dfu-programmer). Windows user can try FLIP software from Atmel. You can upload already compiled hex code from Arduino package or build it from sources (/usr/share/arduino/hardware/arduino/firmwares/arduino-usbserial/Arduino-usbserial-uno.hex or the latest one from github https://github.com/arduino/Arduino/raw/master/hardware/arduino/firmwares/arduino-usbserial/Arduino-usbserial-uno.hex). The steps are:
Put Uno into DFU mode,
sudo dfu-programmer at90usb82 erase
sudo dfu-programmer at90usb82 flash .../Arduino-usbserial-uno.hex
sudo dfu-programmer at90usb82 reset 
reconnect the USB cable.

The LUFA library is needed for building hex file from sources. Download the lib version 100807. Current sources doesn't compile with the latest LUFA(version 101122).
mkdir uno
cd uno
cp -r /usr/share/arduino/hardware/arduino/firmwares/arduino-usbserial ./
wget http://www.fourwalledcubicle.com/files/LUFA/LUFA-100807.zip
unzip LUFA-100807.zip
mv LUFA\ 100807/ LUFA
Fix the LUFA path in "arduino-usbserial/makefile":
     # Path to the LUFA library
     LUFA_PATH = ../..
change to
     # Path to the LUFA library
     LUFA_PATH = ../LUFA
make all
After the successful build the file "Arduino-usbserial.hex" is created. Now you can upload this hex file using above steps.

P.S. After the new firmware upload try to upload and run something using Arduino IDE(the Blink example), to make sure the "USB to Serial converter" firmware works fine.

That's all.

Tuesday, April 26, 2011

Arduino Uno

Arduino Uno is the latest version of the Arduino boards (next to the Duemilanove). The major difference from the previous board is in that it uses the Atmega8U2 micro-controller (instead of FTDI) for communicating with a computer. The Atmega8U2 is programmed as a USB to serial converter by default, but it can be programmed as any other USB devices (keyboard, mouse, joystick and etc...).
Arduino Uno
To upload a new firmware to the Atmega8U2, we need to reset the chip and put it into a DFU mode. There is a description in the Ardunio site how to do that. It can be done easily using 2 M/M jumper wires
M/M jumper wire
Instead of using ground pads(from the description in Arduino site), we can use Arduino's GND pins.
1)Connect Arduino Uno to the computer
2)Hold first wire as pictured in the below image.
3)Connect second wire.
4)Remove second wire then remove first.
Now your Arduino is in DFU mode
The Device manager (in windows 7)
To return to the USB to serial converter mode, just disconnect and connect Arduino.
The upload of a firmware will be in the next article.