NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » ISP programming error

May 12, 2010
by Ralphxyz
Ralphxyz's Avatar

I haven't the slightest idea what I am doing but, I have a ISP programmer and some blank ATmega168 MCUs.

When I try to load a program with the ISP programmer I get this error:

avrdude: AVR device initialized and ready to accept instructions

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

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

avrdude done.  Thank you.

make: *** [tempsensor-upload] Error 1

If a -F will override the perceived problem I'll go for that.

Where would I enter the -F? What am I overriding?

sure appreciate the help,

Ralph

May 12, 2010
by mrobbins
(NerdKits Staff)

mrobbins's Avatar

Hi Ralph,

The AVRDUDEFLAGS probably contains "-p m168" which tells it to expect to be programming an ATmega168 part. The 0x1e940b is for the ATmega168P chip -- almost identical hardware, but they assigned it a different part signature number. Your avrdude may know about it if you change "-p m168" to "-p m168p", but not all versions of avrdude know about the '168P. If that doesn't work, you can add the "-F" to the AVRDUDEFLAGS line, which tells avrdude to ignore the part signature check.

Mike

May 13, 2010
by Ralphxyz
Ralphxyz's Avatar

Is this what you are speaking of:

AVRDUDEFLAGS=-c dapa -pm168

Becomes:

AVRDUDEFLAGS=-c dapa -pm168p

Where would the -F go?

This is from the bootloader Makefile other programs have different syntax.

Ralph

May 13, 2010
by hevans
(NerdKits Staff)

hevans's Avatar

Hi Ralph,

Yep, just turn m168 to m168p

 AVRDUDEFLAGS=-c dapa -p m168p

However like Mike said your version of avrdude might not know that exists yet, so you can just add the -F to instruct avrdude to ignore it. Doesn't really matter where you add it as long as not in the middle of one of the other flags. Putting at the end should work.

AVRDUDEFLAGS=-c dapa -p m168p -F

Humberto

May 13, 2010
by Ralphxyz
Ralphxyz's Avatar

Now what about -c dapa? I get: avrdude: Can't find programmer id "dapa"

if I use that I get this:

miniMac:bootloader Me$ make avrdude -c dapa -pm168p -F -U lock:w:0x2f:m

avrdude: Can't find programmer id "dapa"

Valid programmers are:

 c2n232i  = serial port banging, reset=dtr sck=!rts mosi=!txd miso=!cts [/usr/local/CrossPack-AVR-            20100115/etc/avrdude.conf:668]
dasa3    = serial port banging, reset=!dtr sck=rts mosi=txd miso=cts [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:655]
dasa     = serial port banging, reset=rts sck=dtr mosi=txd miso=cts [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:642]
siprog   = Lancos SI-Prog <http://www.lancos.com/siprogsch.html> [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:629]
ponyser  = design ponyprog serial, reset=!txd sck=rts mosi=dtr miso=cts [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:616]
pavr     = Jason Kyle's pAVR Serial Programmer [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:587]
dragon_pdi = Atmel AVR Dragon in PDI mode   [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:580]
dragon_dw = Atmel AVR Dragon in debugWire mode [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:572]
dragon_hvsp = Atmel AVR Dragon in HVSP mode  [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:564]
dragon_pp = Atmel AVR Dragon in PP mode    [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:556]
dragon_isp = Atmel AVR Dragon in ISP mode   [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:548]
dragon_jtag = Atmel AVR Dragon in JTAG mode  [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:540]
jtag2pdi = Atmel JTAG ICE mkII PDI mode   [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:532]
jtag2avr32 = Atmel JTAG ICE mkII im AVR32 mode [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:524]
jtagmkII_avr32 = Atmel JTAG ICE mkII im AVR32 mode [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:516]
jtag2dw  = Atmel JTAG ICE mkII in debugWire mode [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:508]
jtag2isp = Atmel JTAG ICE mkII in ISP mode [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:500]
jtag2    = Atmel JTAG ICE mkII            [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:492]
jtag2fast = Atmel JTAG ICE mkII            [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:484]
jtag2slow = Atmel JTAG ICE mkII            [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:476]
jtagmkII = Atmel JTAG ICE mkII            [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:468]
jtag1slow = Atmel JTAG ICE (mkI)           [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:461]
jtag1    = Atmel JTAG ICE (mkI)           [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:453]
jtagmkI  = Atmel JTAG ICE (mkI)           [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:445]
avr911   = Atmel AppNote AVR911 AVROSP    [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:439]
avr109   = Atmel AppNote AVR109 Boot Loader [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:433]
butterfly = Atmel Butterfly Development Board [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:427]
usbtiny  = USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/ [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:421]
usbasp   = USBasp, http://www.fischl.de/usbasp/ [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:415]
avr910   = Atmel Low Cost Serial Programmer [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:409]
stk600hvsp = Atmel STK600 in high-voltage serial programming mode [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:403]
stk600pp = Atmel STK600 in parallel programming mode [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:397]
stk600   = Atmel STK600                   [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:391]
stk500hvsp = Atmel STK500 V2 in high-voltage serial programming mode [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:385]
stk500pp = Atmel STK500 V2 in parallel programming mode [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:379]
stk500v2 = Atmel STK500 Version 2.x firmware [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:373]
mib510   = Crossbow MIB510 programming board [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:367]
stk500v1 = Atmel STK500 Version 1.x firmware [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:361]
stk500   = Atmel STK500                   [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:355]
buspirate = The Bus Pirate                 [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:345]
avrisp2  = Atmel AVR ISP mkII             [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:339]
avrispmkII = Atmel AVR ISP mkII             [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:333]
avrispv2 = Atmel AVR ISP V2               [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:327]
avrisp   = Atmel AVR ISP                  [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:321]
arduino  = Arduino                        [/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf:315]

make: *** [fuses] Error 1 miniMac:bootloader Me$

Ralph

May 13, 2010
by Ralphxyz
Ralphxyz's Avatar

If I use STK500 as the programmer I get this ser_open(): error:

miniMac:bootloader Me$ make
avrdude -vvv -c  stk500  -p m168 -F -U lock:w:0x2f:m

avrdude: Version 5.8cvs, compiled on Jan 15 2010 at 17:27:01
     Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
     Copyright (c) 2007-2009 Joerg Wunsch

     System wide configuration file is "/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf"
     User configuration file is "/Users/Me/.avrduderc"
     User configuration file does not exist or is not a regular file, skipping

     Using Port                    : unknown
     Using Programmer              : stk500
avrdude: ser_open(): can't open device "unknown": No such file or directory
make: *** [fuses] Error 1
miniMac:bootloader Me$

I am using a MAC mini OS X 10.6.3 Snow Leopard trying to install the bootloader onto a blank ATmega168P- 20PU MCU using a ISP programmer (isn't that redundant?).

Here is the Makefile from bootloader:

# bootloader

#AVRDUDEFLAGS=-c dapa -p m168p -F
#AVRDUDEFLAGS=-c NerdKit -p m168p
#AVRDUDEFLAGS= -vvv -c  /dev/cu.PL2303-0000101D -p m168p -F
#AVRDUDEFLAGS=-c /tty.PL2303-0000101D -p m168p
#AVRDUDEFLAGS= -c  avr910  -p m168 -F
AVRDUDEFLAGS= -vvv -c  stk500  -p m168 -F

all: fuses install

fuses:
avrdude ${AVRDUDEFLAGS} -U lock:w:0x2f:m
avrdude ${AVRDUDEFLAGS} -U efuse:w:0x00:m
avrdude ${AVRDUDEFLAGS} -U hfuse:w:0xd5:m
avrdude ${AVRDUDEFLAGS} -U lfuse:w:0xf7:m

 install:
avrdude ${AVRDUDEFLAGS} -U flash:w:foodloader.hex:a

Ralph

May 13, 2010
by Ralphxyz
Ralphxyz's Avatar

So I hardcoded the -P port and now I get this:

From the Makefile: AVRDUDEFLAGS= -vvv -c stk500 -p m168 -F -P /dev/cu.PL2303-0000101D

avrdude: Version 5.8cvs, compiled on Jan 15 2010 at 17:27:01
     Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
     Copyright (c) 2007-2009 Joerg Wunsch

     System wide configuration file is "/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf"
     User configuration file is "/Users/Me/.avrduderc"
     User configuration file does not exist or is not a regular file, skipping

     Using Port                    : /dev/cu.PL2303-0000101D
     Using Programmer              : stk500
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_2_ReceiveMessage(): timeout

/dev/cu.PL2303-0000101D is my USB port which works if I am just loading programs to the MCU.

Ralph

May 13, 2010
by Ralphxyz
Ralphxyz's Avatar

Oh one further detail if I try to test the USB port with the yellow and green wires coming from the USB-serial cable shorted together I do not get a echo, nothing happens when I run "screen /dev/cu.PL2303-0000101D 115200". I enter text but it says on the first line and does not echo back when I hit return!

Ralph

Post a Reply

Please log in to post a reply.

Did you know that you can build a circuit to convert the "dit" and "dah" of Morse code back into letters automatically? Learn more...