Friday, March 8, 2013

Arduino UNO Bootloader and Firmware



Arduino UNO by design has come out be a complex system, needing three different flash programs to make it run. I will show where these three are located and method to update them. Below excerpt is from Atmega8u2 /Atmega16u2 datasheet.


When the HWBE fuse is enable the PD7/HWB pin is configured as input during reset and sampled during reset rising edge. When PD7/HWB pin is ‘0’ during reset rising edge, the reset vector will be set as the Boot Loader Reset address and the Boot Loader will be executed .



Hence starting with Atmega8u2 / Atmega16u2 that is used as USB to UART, when it is first connected to the USB port of your PC, it is read as power on by the Atmega8u2 / Atmega16u2 and bootloader is skipped and it enters application section (i.e usb to uart) even though your HWB pin is pulled low (for UNO Rev3). However if you reset Atmega8u2 / Atmega16u2 it is read as reset by the uC and during the rising edge of reset signal the uC enters into the bootloader mode.


Sponsor: www.avmicrotech.com/shop   eshop for your electronic needs



So below are the configuration to flash different parts of devices on UNO

Device Section SourceMethod
Atmega8u2 / 16u2 Bootloader usbdfu Through ISP Header at top right
Atmega8u2 / 16u2 Application Section usbserial Reset Atmega8U2 by shorting reset to gnd to enter bootloader.
Atmega328 Bootloader Optiboot Through ISP Header at the bottom

Actually, the usbdfu and usbserial  are combined together in Arduino distribution as 1 hex file and can be downloaded in one go though Atmega8u2 /  Atmega16u2 6 pin ISP port and using AVR ISP.

.....cont


No comments:

Post a Comment