I am currently working on a project using an Arduino Uno (rev3) board. Eventually I might let it run independantly from Arduino and that got me thinking how the whole programming and bootloader stuff works.
Here is what I know/assume so far:
The board has two chips: The ATmega328 (main chip) and the ATmega16u2 (used as a USB-to-serial bidge).
The firmware of the ATmega16u2 can be changed by activating DFU-mode and using e.g. DFU-Programmer. The Arduino can then be recognized as a HDI / Midi device but is no longer programmable.
When programming the ATmega328, the chip is being reset and on restart the bootloader will load and write the new program via its serial connection and the ATmega16u2-bridge. The ISP-interface of the chip is not used for uploading the new program. Who is initiating the reset in the first place?
The Arduino can be used as a ISP-Programmer to program other external chips. For that some firmware is loaded onto the AATmega328 an the ISP-pins of the chip to be programmed are connected to the one on the Arduino board. Then the Arduino-IDE is configured to use the Atmega328 as a programmer rather than reprogram it.
I hope, at least most of what I have written is correct. My questions then are:
If I put a new/blank AVR onto my board, how does the bootloader get onto that chip? How does the "Burn Bootloader" command work?
Is it possible to upload a hex file to the ATmega328 WITHOUT uploading a bootloader first? Can this be done by using speciaf firmware on the ATmega16u2?
Thanks!
Johannes