Programming the chips
- Created on Sunday, 23 November 2008 04:17
- Last Updated on Wednesday, 30 April 2014 22:18
- Written by Mike Holden
- Hits: 9189
There are several programming options. The cheapest is the parallel port cable, described at the bottom of the page. It requires that your computer has a parallel port, which is less and less common, and it seems to be a bit unreliable.
The commercial options are mainly the Atmel ISP and ISPII and the Dragon. The ISP uses a serial port (also a hard-to-find feature on many laptops), while the ISPII and Dragon are USB devices.
One note for the ISPII users: the documentation is a bit confusing regarding the cable pinout. Here is a crude sketch of the 6-Pin cable that shows the proper connections. The pinout in the documenation is of the circuit board layout, not the cable; the two are mirror images of each other. The word on the left is "Red", it marks the pin one side of the cable.
To program your AVR, you just need a parallel port cable. Cut the end that used to plug into your printer off. Use an Ohm-meter to find which wires connect to which pins on the computer side plug.
Parallel port programmer
Most parallel port cables have the pin numbering molded into the plastic housinig next to each pin.
Parallel port cable pin numbers
The pins connect as follows:
AVR Pin Name
Mega 16/32 DIP Part
|18-25 (any one)||Ground||11|
This uses the Dontronics DT-006 pinout. Dontronics makes lots of AVR proto-boards etc so they are worth checking out.
I use 0.1" spacing header pins on my boards for programming, so I use a female 0.1" spacing header on the programmer. The parallel port cable wires are really flimsy, so be sure to add some strain relief or you will be forever soldering it back together. I glue a stick to the female header then wire-tie it to the cable. My boards all use the pin order below, for historical reasons. If you are starting from scratch using the mega 16/32 you could just use pins 6-11, which is the easiest to breadboard. The Vcc connection isn't necessary for the parallel port programmer, but if you were to use another programmer (such as the AVR ISP from Atmel) you might need it so I include this pin on circuit boards if I go through the trouble of having them fabbed.
Programmer Pin ordering for Holden's boards:
Chip programmer, with strain relief and labels visible
Note that to program your chip you must have it powered and either connected to an oscillator or with the fuses designating the internal oscillator.
If you are not sure of your pins or hardware setup, try reading the chip's fuses and flash before programming. This can help debug connection and hardware problems.