I have been struggling with making an Arduino for a while (was successful in making a breadboard version using an ISP programmer cable). They say that the Arduino bootloader is made so that no external circuitry is required to program the ATmega8. But when I looked into the schematics there is the normal circuit required for the serial connection. Then what does the bootloader actually do?
Answer
The bootloader is a small program in the AVR's flash which is never overwritten and runs on powerup. The job of the bootloader is to read program data from the UART and write it to the internal flash. Without a bootloader, the only way to load code is using ISP.
The AVR ATMega8 comes with no code in the flash. Code can be uploaded via the ISP (in-system-programming) pins, using an AVR ISP programmer (or even another Arduino).
For Arduino, the ISP is used only once (at manufacture) - to upload a small bootloader. On powerup, the bootloader runs and communicates with the serial UART (TX + RX pins). Now, Arduino can be programmed via the serial pins using the STK500 protocol.
As the serial pins are (typically) connected to an FTDI USB to serial chip, the Arduino can also be programmed over USB.
No comments:
Post a Comment