Programmers

All on one SLOW page
Serial Port
Parallel Port
Smart Programmers
Serial Loaders

Projects

ATmega8 Serial LCD
ATtiny2313 Serial LCD
ATtiny4313 Serial LCD
ATmega328 SIRC
ATtiny2313 SIRC
40-pin Dev Board
28-pin Dev Board
AVR PS/2 Keyboard
AVR MAX232 RTS/CTS
AVR Dual RS232 Ports

Minimal Circuits

ATmega16
ATmega32
ATmega644
ATmega1284
ATmega8515
ATmega8535
ATmega8
ATmega48
ATmega88
ATmega168
ATmega328
ATmega162
ATmega128
ATtiny13
ATtiny2313
ATtiny4313
ATtiny24
ATtiny84
ATtiny25
ATtiny45
ATtiny85

Other Stuff

ATtiny13 vs ATtiny85
ATmega8 vs ATmega88
ATmega16 vs ATmega164
ISP and SPI
MAX232 Arduino
A small FAQ
Hardware Info

Arduino AVR ISP Programmer + Arduino Sketch Downloader

This circuit uses the Arduino ISP code to implement a serial driven ISP, but then uses a USB to TTL converter to get the serial. It is fairly versatile - with it you can:

The schematic as shown assumes you will be putting a two position toggle switch and three LEDs somewhere off-board. There is no reason they couldn't be on the board, but that will need to be an early design choice. I want to say now that this is not the fastest AVR programmer. Its versatility is what sets it apart from the others. If you are the type who burns a bootloader, then uploads code, this is the one for you. If you just flash the code, you might be a lot happier with the parallel port programmer.

Schematic Diagram

USB ArduinoISP AVR programmer

Parts

Software

The software needed is the Arduino environment, which comes with the Arduino ISP as an example. It will work out of the box.

Notes

  1. The target microcontroller may provide it's own power, or get it from the USB bus. I wired this one so the target must supply its own power.
  2. S2-6 Controls auto-reset, and is ON to reprogram the ATmega328, OFF in normal operation.
  3. S2-5 Enables the serial mux to ATmegax8, and is ON to reprogram the ATmega328 (with the lid removed), OFF in normal operation.
  4. S2-4 Enables the serial mux to an external bootloaded AVR, and is OFF in normal operation.

Assembly

I mounted the breakout board upside down because the pin identification is on the bottom, except for the four that duplicate TX, RX, and a couple more, which are on the top with the LEDs. Keep that in mind when you put the headers on. It took me about four hours to assemble the ArduinoISP programmer. About half an hour was spent hogging out the little openings in the box.

If you decide to build it with just a board, and no external parts, you will want to put the LEDs and switch on the board. In that case you can use a SPDT slide switch to select between the ISP and Serial modes.

Configuration

  1. Build the programmer as shown in the schematic.
  2. Setup the Arduino environment.
  3. Turn dip switches 5 (Serial to the 328) and 6 (Auto Reset) both on to allow uploading to the ATmega328.
  4. Hook up a USB cable to the Sparkfun USB to TTL BoB.
  5. Load and build the AurduinoISP sketch from the examples.
  6. Upload it. It should just say the sketch size when it finishes. Watch the lights on the BoB for activity.
  7. Flip dipswitches 5 and 6 off.
  8. Plug in the appropriate 6 or 10 pin cable to SV1 or SV2, and to a target.
  9. Power up the target.
  10. Use AVRDUDE to burn a program into the target.
  11. The target will reset and begin execution.
If you have built it without the external switch to select between ISP and Serial downloading, leave dipswitch 5 on, so the ArduinoISP code will see the serial data from the PC. It will then act as an AVR ISP. Open dipswitch 5 and close dipswitch 4 and the serial data will go to the 6-pin sip, for programming an external Arduino.

If you look at pins 1, 2, and 3 on X2 you will see ISP, GND, and Serial. These go to a toggle switch that selects whether the ArduinoISP gets the serial data from the PC, or the data goes out the 6-pin SIP to another board with a downloader installed. If you choose to use that switch, make sure you turn DIP switch 4 & 5 OFF, or you will be running two outputs into the same wire. To use the serial as an external Arduino sketch downloader, ground "Serial#". To use it as an ISP programmer, ground "ISP#". Do not ground both unless you have extra 74HC125's around. Trust me.

Also on that 8-pin SIP are three lines for LEDs to indicate power, programming, and error. The power LED "throbs" when the power is on - a cute feature of the Arduino ISP. The LEDs are on when the line is pulled high, so ground the cathodes.

If you have access to an ATmega168 or ATmega328 with the Arduino bootloader in it already, you won't have to write one line of code, nor will you need another programmer to program this one. I picked up a pair of ATmega328's with the Arduino bootloader in them at Evil Mad Science. The ATmega328 is getting hard to find right now, but the ATmega168 will do fine. Just make sure to select the right microcontroller in the Arduino environment when you flash the programmer with the Arduino ISP sketch.

You may get the error:

avrdude: Can't find programmer id "arduino"

Don't try to change your local Arduino preference file. Although the local file is supposed to override the global one, the Arduino environment will just change it back. Instead, go to the AVRDUDE site and get the latest version and install it. It supports this programmer directly, as "arduino".