Bootloader

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
eventhorizon
 
Posts: 114
Joined: Tue Jan 25, 2011 6:09 pm

Bootloader

Post by eventhorizon »

Okay, maybe this is a bit off my list but how do I use a bootloader? For the past few hours I've been reading about bootloaders, but didn't really understand it. The thing is I want to flash/program/read/write my mega8/tiny2313 straight from the USB port with no other IC (or using the 2313 to program another AVR). I read about several bootloaders but the schematics still include the FT232 chips.

Another option is that I use my tiny 2313 to convert USB to ISP. I know of the USBtinyISP but really don't get how it works..

User avatar
chatham
 
Posts: 144
Joined: Thu Feb 04, 2010 2:30 am

Re: Bootloader

Post by chatham »

So, a bootloader is code that sits in a special area of memory, runs at startup, checks for a certain condition (pin held low, timer, etc.), and if that condition is true, waits for data with which to reprogram itself, and when it gets that data, rewrites the program space of the chip with the uploaded program. If the condition is false, it exits out of the bootloader memory block, and starts running the program that's been loaded onto it.

The meat and potatoes of the bootloader, though, is how you transfer the data to the bootloader when it's waiting for the data. This is where the FTDI chip comes in - it's a chip that translates USB data (which has a complicated protocol) to standard serial data, which is a simple protocol, and the AVR has built-in hardware to read it.

The USBtinyISP would be one way to take your ATtiny and turn it into a dedicated ISP programmer, with which you can program other chips. It might be possible to take that firmware and modify it into a bootloader, but that's probably a pretty advanced project.

Another option is this:
http://www.obdev.at/products/vusb/bootloadhid.html
It can be a little tricky to get working, but it's a bootloader that also uses a USB firmware driver for the AVR, and allows you to communicate via USB.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”