[!] The blog has moved [!]

The blog has moved to http://carlitoscontraptions.com/.

You will be redirected to the new URL in 5 s. Sorry for the inconvenience.

May 02, 2008

ATmega168 Parallel Programmer

I own a few Rev. C Bare Bones Boards witch came with ATmega168 chips burned with the old Arduino bootloader (NG). I wanted to upgrade them to the newer (Diecimilia) bootloader so I built a parallel programmer following the instructions in the Arduino website and using parts I found in the garbage (as usual).

  • Two 470 Ohms resistors
  • One 220 Ohms resistor
  • Some wire
  • A female header at least 3x2
  • A ferrite core (not required but looks cool)
  • Some heat shrink (it could be replaced by some electrical tape)
  • A male parallel port connector (DB-25)
Programmer Schematics
(this is a vectorized version of the original schematics on the arduino site)


I got a DB-25 connector from an extension parallel port of a PC I found in the garbage. First, I removed the original cable that came with it and I soldered the programmer's resistors to the back of the DB-25 and connected them to new wires. Then, I covered the resistors and cable connections with a piece of heat shrink tubing.

The new wires where terminated in a 4x2 female header (even though there are only 5 wires). The wires and female headers come from an old computer (they connected the power buttons and the case LEDs to the motherboard). I cut the header to size from a larger header (form the same old computer) and I used an extra row to mark it with a white pin cap so I could easily remember where the #1 pin is located.

Finally, I added a ferrite core and twisted the cables in order to reduce noise and cross-talk. I don't think this is really required but it looks nice.


Eko Setio said...

Hi Carlitos..

Im a total embedded noob playing around with an empty atmega168 and arduino.

what program did you use to upload the bootloader? I cant upload sketch nor the bootloader to my Atmega168. I hope you have some tips for me, i've followed everything the site told me to do. Ive been hangin around the arduino forum for days with no result.

Maybe you could also make a tutorial as well :D

Carlos said...

Hi Eko,
The Arduino bootloader can be burnt to the Arduino board by using the Arduino software.

If you have no Arduino board whatsoever, Maybe you should have a look at this (if you haven't already): www.arduino.cc/playground/Learning/AtmegaStandalone

If you prefer to program in C and then compile it and upload it to the ATmega, you could use AVR-GCC and AVRDUDE.

I hope this helps. Good Luck

Bala C said...

Hi Carlos,

I have wired up your parallel port programmer for use with an ATMEGA8 in the Arduino Diecimal board as an external programmer.

When I try to compile and upload my programs using Arduino and your parallel prot circuit, I get the error:
Can't find programmer id "null"

I added the statement upload.using= Parallel Programmer to the preferences.txt file.
I got the same error.
I changed this to upload.using = dapa
Same error
I even included statements:
Parallel.name=Parallel Programmer
Upload.using = avrdude.conf:658

same error.
Sorry for being naive. Can you help with the correct statements /advice.


Carlos said...


I use the programmer only for burning the bootloader, and I am very far from anything remotely similar to an Arduino at the moment (and for a long time) so I cannot try and compile something to see how it works. I think your best chance is to look at the page where I got the programmer model (http://www.arduino.cc/en/Hacking/ParallelProgrammer) and the Arduino website in general.

Enjoy your Arduino hacking.

Eko Setio said...

Maybe its a good idea that you first check your parallel port settings. Make sure that it is ECP. you can change it from bios.


Bala C said...

Hi Carlos and Setio,
Actually, Initially I wired the parallel port adapter ONLY for bootloading the ATMEGA8, as I anyhave the serial cable for laoding programs via the Diecimla to 'bootloaded' chip. I tried bootloading via diecimla and via a breadboarded version (as per arduino site). Using the Arduino software if I chose the diecimla board option and then try to bootload, I get a message avrdude: initialisation failed, rc=-1
invalid device signature. Expected signature for ATMEGA168 is 1E 94 06.
If I use the ArduinoNG or older w/parallel programmer option I get a simialr message with expected signature for ATMEGA8 is 1E 83 07

Your site says enter an id in preferences.txt at the upload.using line for the programmer from the programmers.txt file. Obviously my statements (ref earlier email) are wrong. Hence,which is the correct id for your parallel port programmer? Are any other lines to be added in this case?

I need to be able to bootload the ATMEGA8, hence I'd very much appreciate your help.

Since giveio is installed the parallel port is recognised.

Eko Setio said...


I used UISP and AVRDUDE instead of the Arduino software.

RC=-1 might indicate that ur parallel programmer is not working.

Again, make sure that your parallel port is ECP. have u done this? otherwise this will not work at all. Check this via the device manager. Another thing was the interrupts. I cant remember which to use just make sure its ECP and try it with the three different option of interrupts.

Btw, i used it as port1 and address is 0x378.

I used the UISP to check if my parllel programmer is working or not, then i used AVRDUDE to upload my hex file.

check out my questions at the arduino forum. they too have some info for Atmega8.



J said...

Sweet article, thanks! :)

I built one of these purely to burn the boot loader to my ATMega168, but for several frustrated hours I kept getting:

avrdude: Device signature = 0x000102
avrdude: Expected signature for ATMEGA168 is 1E 94 06
Double check chip, or use -F to override this check.

Occasionally the device signature would be another random number, but mainly 0x000102.

I found that shortening the cable between the parallel port and chip solved the problem. I have also read that lower value resistors could have been a solution too.

Carlos said...

Hello J,

I'm glad you liked the article.

The length of the wire can be a problem indeed. Thus is where twisting the wires together and using a ferrite core comes in handy.

I'm glad you got your programmer finally working.


sajid said...

Hi, carlitos
i think u can help me in my project coz im facing a problem which is related to prgramming atmega168 through USBASP programmer
i have avr dude with me,
eroor showing is the device signature error and the same that expected signature is 1E94 06..etc
can u help to remove this error....

Carlos said...


I'm afraid I cannot help you pout with that one since I have never tried to do that.

Sorry about that. Cheers

Anonymous said...

Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!