Basics: AVR Target Boards and Arduino Compatibility

Gary writes:

I have fallen in love with your Diavolinos – thank you!
My question: does the “Simple target board” allow for the 6-pin FTDI Friend hookup to upload sketches? This is quick and easy with the Diavolino. I’m new to reading circuits and stuff, and I cannot tell looking at the target board. It says to use in-system programmer, but I prefer to not buy another interface. Thanks!

Excellent question! It is certainly possible, but not as quick and easy.  Both the Diavolino and our ATmegaXX8 target boards boards use the same chip, usually the ATmega328P.  But, one might say that our ATmegaXX8 board is a simple AVR target board optimized for use with an AVR ISP programmer (like the USBtinyISP), whereas the Diavolino is a simple target board optimized for use with the FTDI interface.

XX8 Target Board

Versus a “bare” target board (with just the chip and power), there are four things that you would normally add, in order to use the FTDI interface to upload a sketch from within the Arduino environment:

1. The crystal oscillator, typically 16 MHz.  With a bare chip, you can use the internal oscillator.  But the Arduino ecosystem typically expects an external oscillator. We normally use a 16 MHz crystal with two little caps, and there’s a place for them on the ATmegaXX8 board.  Alternately, you could use a 3-pin ceramic resonator — and that’s why the crystal location on the PCB (“XTL”) has three pins, not two.

2. Serial connection to the FTDI interface.  See our article here about how to add an FTDI compatible header to the ATmegaXX8 board. (Spoiler: you need a 6-pin header and some wire.)

3. Auto-reset circuit.  When the Arduino software begins to upload to the board, it initiates the process by effectively pressing a reset button. You can add a reset button (that connects pin 1 of the ATmega328 to ground) and press that manually when you begin programming, or use the “auto-reset” circuit, to let the FTDI interface do it automatically.  To build the auto-reset circuit, you’ll need to add a 0.1 uF capacitor between pin 6 (“RTS#”, the “Green” wire pin on one end) of the FTDI interface and the reset pin of the IC, pin 1.  You’ll also need to add a 10k resistor between the reset pin and VCC (your +5V power supply).  You might look at the Diavolino schematic (available here) or this answer on stack exchange for more information.

4. The bootloader.  The AVR microcontroller on an Arduino board comes preprogrammed with a small piece of software that allows it to be reprogrammed through the serial interface, via the FTDI cable. A bare chip from the factory does not have this software and it does need to be programmed.  You can purchase a chip pre-loaded with the Arduino bootloader, or start with a bare chip and program the bootloader yourself.  Since you already have a Diavolino, you can use that to program the bootloader, using the method described here. You could also use our ISP shield kit to simplify wiring, if you plan to build many.

Finally, there’s also an article at Instructables, about making an Arduino-compatible board from one of our target boards, including the process of adding additional (optional) components such as a voltage regulator and LED to blink.

Print Friendly, PDF & Email

2 thoughts on “Basics: AVR Target Boards and Arduino Compatibility

  1. Which bootloader would you recommend for these boards — for manual reset and/or auto-reset?

    What do you tell the Arduino IDE the board type is?

Comments are closed.