8
\$\begingroup\$

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?

\$\endgroup\$
  • 1
    \$\begingroup\$ no external circuitry is a preposterous claim... to talk to a computer over a serial port you at least need an RS232 transciever, like a MAX232 of some sort; or as the arduino does, you can talk TTL UART directly to a USB interface chip like FTDIs. \$\endgroup\$ – vicatcu May 13 '10 at 18:30
12
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ So you are saying that if I have a atmega8 chip with a bootloader burned in it I can remove all the circuitry for the ISP and just connect the proper pins from the serial to the arduino? Also can you tell me how will I connect the serial with the atmega8 \$\endgroup\$ – Rick_2047 May 12 '10 at 12:51
  • 2
    \$\begingroup\$ Once you have the bootloader, here's a very minimal Arduino circuit. Connect your PC (via a TTL level converter) to the TX/RX/GND pins. profmason.com/wp-content/uploads/2008/09/arduinopins.jpg See this question for some more details: chiphacker.com/questions/2512/ftdi-basic-breakout-5v \$\endgroup\$ – Toby Jaffey May 12 '10 at 12:55
  • 1
    \$\begingroup\$ The max232 converts RS232 level serial (as comes from the 9-pin connector on a PC) to TTL level (5v) signals suitable for talking to the Arduino/AVR. The max232 circuit can be replaced by an FTDI USB to TTL serial chip to connect to a PC. \$\endgroup\$ – Toby Jaffey May 12 '10 at 13:21
  • 2
    \$\begingroup\$ A little note here: The Arduino bootloader only listens on the serial port for new code for a very short while at startup. Older Arduino bootloaders wait for a few seconds before the start executing code. Newer bootloaders start very quickly and have to be reset by the DTR line from an FT232. If you plan on using a max232, upload the older bootloader. Also check Sparkfun (sparkfun.com/commerce/tutorial_info.php?tutorials_id=104) for some great AVR tutorials. \$\endgroup\$ – bpijls May 12 '10 at 13:33
  • 2
    \$\begingroup\$ It's actual AVR object code. The Arduino beats some rival platforms (eg. Basic Stamp) in that it runs compiled object code not an interpreter. \$\endgroup\$ – Toby Jaffey May 12 '10 at 14:14
3
\$\begingroup\$

You can buy ATmega328 chips with the boot-loader on them here.

\$\endgroup\$
  • \$\begingroup\$ I just ordered 4 today (from ZA site though) :) \$\endgroup\$ – leppie May 12 '10 at 17:20
1
\$\begingroup\$

They probably mean that if you buy a pre-built, assembled Arduino Uno, you don't also need to buy a programmer. Like with a lot of other electronics starterkits. You can program the Arduino Uno board with just a usb (A > B) cable.

However if you are going to build an Arduino of your own, you of course will need an external circuit (for example an AVR ISP programmer) or the Max232 or FTDI kind of stuff.

\$\endgroup\$
0
\$\begingroup\$

The idea behind the Arduino bootloader is that you don't need any specialty hardware or circuits to re-program them, compared to the initial programming of it, or older microcontroller, which often need a dedicated programmer (like PicKit2 for PIC MCUs). The bootloader allows programming over a basic serial connection.

Of course, at the time, you needed the serial link, typically a rs232 converter from TTL to RS232. Then serial ports being phased out, usb to serial became ubiquitous, allowing for that to replace a max232 or similar. And now, the use of USB enabled Atmel microcontroller allow even that to be unnecessary, so a single ic with minimal passive parts could provide the Arduino functions and USB to Serial. Now you only need a usb cable and a few passive to upload a sketch. The initial programming of the bootloader still requires traditional ICSP programming.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.