Device signature = 0x000102

I’m trying to burn the bootloader using the Atmel168 makefile supplied with Arduino0009.

The first command goes fine:
./avrdude -c dapa -p m168 -P /dev/parport0 -e -F -u -U lock:w:0x3f:m -U efuse:w:0x00:m -U hfuse:w:0xdf:m -U lfuse:w:0xc7:m (i have also tried hfuse 0xdd and lfuse 0xff, although to be honest, I don’t know these flags are.)

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9406 ← device signature looks okay here
avrdude: erasing chip
avrdude: reading input file “0x3f”
… etc …
(I am using a parallel programmer)

Then the second command, I assume to burn the image, fails:

./avrdude -c dapa -p m168 -P /dev/parport0 -U flash:w:ATmegaBOOT_168_ng.hex -U lock:w:0x0f:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

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

avrdude done. Thank you.

make: *** [isp] Error 1

I’ve spent a good deal of time tinkering, testing, browsing google/arduino.cc, trying uisp, etc. No luck so far :slight_smile: Although, it’s interesting to note that I did get one of my ATmega168s to burn using uisp last night, though when I reproduce the steps, I can’t get my last two to burn. The Arduino IDE just says the programmer is not responding, and no activity is happening on pin 13. However, uisp says “AVR Direct Parallel Access succeeded after 0 retries” in a couple places, too. And, as you see, avrdude is only half-happy. Boggle!

Hey how'd that -F sneak in the first line? :-) Oh well, the device signature is still correct the first time without it, and the behavior appears the same, too.

Just to keep all the info posted, I did finally get both of my other ATmega168s programmed using avrdude over parallel (dapa). How?

That's the interesting part ...

I kept retrying each command as fast as possible (up, enter, up, enter, ...); most of the time I would get: avrdude: Device signature = 0x000102

However, if I tried fast enough, it would eventually work. After enough tries, and some tired fingers, I got the bootloader to upload without complaining about the device signature at all, and everything checked out. Upon disconnecting the parallel connection, I could upload sketches. Oy!

Now I'll be curious as to why this was happening, especially as I burn more ATmega168s :-)

Good to know you got it working, even if it's still a challenge. What operating system are you using?

I don't have a parallel port programmer or a computer with a parallel port at the moment, so I'm afraid I don't have much advice for you. I hope you can figure it out though, because I'm sure there are a lot of people who would like to be able to burn the bootloader with a parallel port programmer.

I also had the same problem with atmega8 and atmega168 chips. My first solution was to shorten the wires between the parallel port and my custom connector. That got rid of the stability issues with the atmega168 but the atmega8 still refused to be detected by avrdude. I then replaced both 470 ohm resistors by 220 ones and the atmega8 was finally properly detected.

So, when building the http://www.arduino.cc/en/Hacking/ParallelProgrammer you must have the shortest cable possible running from your parallel port to the target board, or simply use lower resistor values.

I successfully programmed the atmega168 with the following commands:

avrdude -c dapa -p m168 -P /dev/parport0  -e -u -U lock:w:0x3f:m -U efuse:w:0x00:m -U hfuse:w:0xdf:m -U lfuse:w:0xc7:m 

avrdude -c dapa -p m168 -P /dev/parport0  -U flash:w:ATmegaBOOT_168_ng.hex -U lock:w:0x0f:m

But anybody know the commands to burn the bootloader and set the fuses for the atmega8?

I tried to use the menu commands from the Arduino IDE but avrdude just chugs away for a very long time without any errors or messages. I always have to force quit it (avrdude also takes 100% of the cpu when used through the IDE).

About burning the ATmega8: you can see the fuse settings and path to the .hex file in the boards.txt file in the hardware/ sub-folder of the Arduino folder (Arduino 0010).

The parallel port programming should finish eventually, but it might take 10 minutes or more. I don't have a parallel programmer, so I was following the advice of ucHobby, which suggested that you need a very long delay (between bytes, I guess) for a reliable programming. I'm going to try removing the delay in Arduino 0011.

To burn the bootloader with a dapa parallel programmer to atmega168 on a ng board i had to replace the 470 Ohm Resistors with 220 Ohm and the 220 Ohm with a 100 Ohm Resistor.

Hi Mellis,

10 minutes! I believe that delay is way too high. When programmed from the command line it takes less than 30 seconds! I figured out the commands to burn the bootloader and set the fuses with your the boards.txt file as you suggested:

avrdude -c dapa -p m8 -P /dev/parport0  -e -F -u -U lock:w:0x3f:m -U hfuse:w:0xca:m -U lfuse:w:0xdf:m 

avrdude -c dapa -p m8 -P /dev/parport0  -U flash:w:ATmegaBOOT.hex -U lock:w:0x0f:m

Can you try deleting this line from your programmers.txt file:

parallel.delay=800

and then trying to burn the bootloader from the IDE?

Can you try deleting this line from your programmers.txt file: parallel.delay=800 and then trying to burn the bootloader from the IDE?

Ok, that is a lot faster! It works :D

Here are some notes for better stability when uploading the bootloader: a) power the arduino with an external power supply (I use a 12V one) because when powered through USB I still get stability issues. b) remove any components attached to the board like a LED connected to pin 13 (I have pre NG boards without the integrated led).