AVR Bootloader Tutorial 18
AVR Bootloader Tutorial 18
com/10778/avr-bootloader/
Here you can learn many more interesting and useful about USB bootloaders for AVR microcontrollers. In
practice, one of the most proper microcontroller programming method is using a bootloader program,because you
don’t need any special external programming hardwares or special programming skills. All you just need is to
connect a standard cable from your PC to the target microcontroller board and run special program on PC which
communicates with MCU bootloader program!
Almost all AVR ATmega family microcontrollers have ability to be programmed with bootloader. Bootloaders can
be various sizes and can use different algorithms and interfaces (I2C, USART, SPI, USB…) from where program
will be loaded.
The Program start address depends on AVR fuse settings, ie if fuse settings instructs that program counter has to
jump to bootloader section after the reset operation, then first of all, the bootloader has to be executed. In short, if
a microcontroller is preconfigured, then after the reset event, it starts running not from the default start memory
location (usually at 0×0000 address) but at some specific location, where usually bootloader resides.
Note that most of AVR bootloaders are using COM port for connectivity with the PC, and for our convenience
these can be adapted to USB by using USART to USB hardware bridges. But it is more flexible if USB can be
interfaced directly to the MCU and communication task is done by firmware USB driver, without any additional
hardware.
As said, it is very convenient to use any microcontroller design integrated with a ‘firmwareonly usb driver’ system,
because it allows us to handle usb connectivity (and programming) without any external hardware dongle. But
how, from where we get a suitable one? One answer to this FAQ is V-USB’s ‘BootloadHID’. This USB driver is a
firmware-only implementation of the USB 1.1 standard (low speed device) on cheap single chip microcomputers
of Atmel’s AVR series!
BootloadHID is a USB boot loader for AVR microcontrollers. It can be used on all AVRs with at least 2 kB of boot
loader section, like our ATMega8. The firmware is flashed into the upper 2 kB of the flash memory and takes
control immediately after reset. If a certain hardware condition is met, the boot loader waits for data on the USB
interface and loads it into the remaining part of the flash memory. If the condition is not met, control is passed to
the loaded firmware. The uploader tool requires no kernel level driver on Windows and can therefore be run
without installing any DLLs. You may get all about this from here http://www.obdev.at/products/vusb/index.html
→ Part 19: Working With Bootloaders & Build Your Own Bootloader
← Part 17: AVR & Robotics