avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-chat] Can't program an ATMEGA48 using avrispmkII


From: TODD BATZLER
Subject: Re: [avr-chat] Can't program an ATMEGA48 using avrispmkII
Date: Wed, 11 Oct 2006 08:00:08 -0500

We've had production/manufacturing issues related to ISP programming of Atmel
parts, although I've no direct experience with mega48's.

This was tracked down to the ISP programming cable draped over a switching 
power supply.
The noise from this supply (presumably) caused the incorrect fuses to be 
programmed  into
the part.  Unfortunately Atmel designed the part so you can disable the spi 
from the spi
in a couple of ways by setting the 'wrong' fuses.  Analysis of the devices when 
placed in 
a parallel programming mode (in an STK500) showed that on some parts the RESET 
pin
was disabled (required for ISP) and the SPIEN bit was set, disabling the SPI 
interface.
Of course the 'correct' values for the fuses did not reflect this.  I've 
mentioned on several
occasions to the VP's of Atmel that come here that I think it should be 
impossible to disable
the SPI interface from the SPI interface.  
The devices were 'recovered' in the parallel programmer because it will erase 
the entire flash space before
erasing all the fuse bits to factory condition.

Of course, if the lock bits get set wrong, I think you're out of luck.
Hope this helps.



Todd Batzler
Senior Staff Engineer
Miller Electric Mfg Co
1635 W Spencer St
Appleton, WI 54914-0000 USA

Phone:  920 735 4230
Fax:  920 735-4488
email:  address@hidden

>>> "Eddie Dawydiuk" <address@hidden> 10/10/2006 6:43 PM >>>
Hell all,

I am new to list, I've searched google as well as this mailing list to 
find a solution to my problem but so far I have been unable to. During 
development I use AVR studio to program my development board. I am now 
integrating the programming of the AVR into our production framework. I 
installed avrdude version 5.1, initially I was able to program my device 
using avrdude. Recently I have found several boards are in a state in 
which I can not program them using avrdude. The initial failure condition 
is the signature is not properly read.

e.g.

address@hidden:root]#avrdude -p m48 -P usb -c avrispmkII -U 
flash:w:/var/ts-production/bitstreams/tsbat3.hex

avrdude: stk500v2_recv_mk2: error in USB receive

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0xffffff
avrdude: Yikes!  Invalid device signature.
          Double check connections and try again, or use -F to override
          this check.


avrdude done.  Thank you.

address@hidden:root]#

Although if I add the -F option the next failure condition is a failure 
when writing to flash memory.

address@hidden:root]#avrdude -p m48 -P usb -c avrispmkII -U 
flash:w:/var/ts-production/bitstreams/tsbat3.hex -F
avrdude: stk500v2_recv_mk2: error in USB receive

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0xffffff
avrdude: Yikes!  Invalid device signature.
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be 
performed
          To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "/var/ts-production/bitstreams/tsbat3.hex"
avrdude: input file /var/ts-production/bitstreams/tsbat3.hex auto detected 
as Intel Hex
avrdude: writing flash (3594 bytes):

Writing | #                                                  | 1% 
0.02savrdude: stk500v2_paged_write: write command failed with 129
Writing | ################################################## | 100% 0.06s

avrdude: failed to write flash memory, rc=-1

avrdude: safemode: Fuses OK

avrdude done.  Thank you.


I ran into this several times earlier and I was able to get the boards 
into a state where I could program them by using AVR studio and modifying 
the ISP frequency. After doing so I found avrdude could properly program 
the boards. I've tried to use the -B flag to modify the ISP frequency from 
avrdude although this doesn't seem to help. Even worse yet AVR studio no 
longer seems to work. The command I have been using that lead to this
problem is listed below.

        avrdude -p m48 -P usb -c avrispmkII -v -e -F -u -B 100\
         -U flash:w:bitstearm.hex \
         -U lfuse:w:0x0E:m \
        -U hfuse:w:0xDF:m \
        -U efuse:w:0x01:m

One thing to note, I have a known working
board that has only been programmed with AVR studio and I can still
program this board with AVR studio. The other three boards I tried to
program with avrdude are all in this same state where I can't program
them.

Could someone provide any insight, any troubleshooting suggestions? Is
there any more information I could provide that would be helpful?

//Eddie





_______________________________________________
AVR-chat mailing list
address@hidden 
http://lists.nongnu.org/mailman/listinfo/avr-chat




reply via email to

[Prev in Thread] Current Thread [Next in Thread]