Archiv verlassen und diese Seite im Standarddesign anzeigen : Atmega32 reagiert nicht mehr nach fuse Änderung
totix800
27.02.2011, 16:22
Hi,
ich experimentiere gerade ein bisschen mit einem RNControl V1.4 Board herum und mir ist gerade folgendes Problem in die Quere gekommen.
Ich hab ganz normal mittels folgendes Befehls mein Programm über einen mySmartUSB Programmer via avrdude auf meinen Atmega32 übertragen:
avrdude -p atmega32 -c avr910 -U flash:w:programm.hex -v -F -P /dev/ttyUSB0
Beim übertragen habe ich folgende Frage gestellt bekommen, die ich bis jetzt noch nie gestellt bekommen hab:
"Would you like this fuse to be changed back? [y/n]"
Device code: 0x29 = (unknown)
Device code: 0x2a = (unknown)
Device code: 0x2b = (unknown)
Device code: 0x2c = (unknown)
Device code: 0x2d = (unknown)
Device code: 0x2e = (unknown)
Device code: 0x2f = (unknown)
Device code: 0x30 = AT90S4433
Device code: 0x31 = (unknown)
Device code: 0x32 = (unknown)
Device code: 0x33 = (unknown)
Device code: 0x34 = AT90S2333
Device code: 0x35 = (unknown)
Device code: 0x36 = (unknown)
Device code: 0x37 = (unknown)
Device code: 0x38 = AT90S8515
Device code: 0x39 = (unknown)
Device code: 0x3a = ATMEGA8515
Device code: 0x3b = (unknown)
Device code: 0x3c = (unknown)
Device code: 0x3d = (unknown)
Device code: 0x3e = (unknown)
Device code: 0x3f = (unknown)
Device code: 0x40 = (unknown)
Device code: 0x41 = ATMEGA103
Device code: 0x42 = (unknown)
Device code: 0x43 = ATMEGA128
Device code: 0x44 = (unknown)
Device code: 0x45 = ATMEGA64
Device code: 0x46 = (unknown)
Device code: 0x47 = (unknown)
Device code: 0x48 = (unknown)
Device code: 0x49 = (unknown)
Device code: 0x4a = (unknown)
Device code: 0x4b = (unknown)
Device code: 0x4c = AT90S2343
Device code: 0x4d = (unknown)
Device code: 0x4e = (unknown)
Device code: 0x4f = (unknown)
Device code: 0x50 = (unknown)
Device code: 0x51 = (unknown)
Device code: 0x52 = (unknown)
Device code: 0x53 = (unknown)
Device code: 0x54 = (unknown)
Device code: 0x55 = ATtiny12
Device code: 0x56 = ATtiny15
Device code: 0x57 = (unknown)
Device code: 0x58 = (unknown)
Device code: 0x59 = (unknown)
Device code: 0x5a = (unknown)
Device code: 0x5b = (unknown)
Device code: 0x5c = (unknown)
Device code: 0x5d = (unknown)
Device code: 0x5e = ATtiny2313
Device code: 0x5f = (unknown)
Device code: 0x60 = ATMEGA161
Device code: 0x61 = (unknown)
Device code: 0x62 = (unknown)
Device code: 0x63 = ATMEGA162
Device code: 0x64 = ATMEGA163
Device code: 0x65 = (unknown)
Device code: 0x66 = (unknown)
Device code: 0x67 = (unknown)
Device code: 0x68 = AT90S8535
Device code: 0x69 = ATMEGA8535
Device code: 0x6a = (unknown)
Device code: 0x6b = (unknown)
Device code: 0x6c = AT90S4434
Device code: 0x6d = (unknown)
Device code: 0x6e = (unknown)
Device code: 0x6f = (unknown)
Device code: 0x70 = (unknown)
Device code: 0x71 = (unknown)
Device code: 0x72 = ATMEGA32
Device code: 0x73 = (unknown)
Device code: 0x74 = ATMEGA6450
Device code: 0x75 = ATMEGA6490
Device code: 0x76 = ATMEGA8
Device code: 0x77 = (unknown)
Device code: 0x78 = ATMEGA169
Device code: 0x79 = (unknown)
Device code: 0x7a = (unknown)
Device code: 0x7b = (unknown)
Device code: 0x7c = (unknown)
Device code: 0x7d = (unknown)
Device code: 0x7e = (unknown)
Device code: 0x7f = (unknown)
avrdude: avr910_devcode selected: 0x01
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.06s
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATMEGA32 is 1E 95 02
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
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 "can_testprogram.hex"
avrdude: input file can_testprogram.hex auto detected as Intel Hex
avrdude: writing flash (1102 bytes):
Writing | ################################################## | 100% 7.19s
avrdude: 1102 bytes of flash written
avrdude: verifying flash memory against can_testprogram.hex:
avrdude: load data flash data from input file can_testprogram.hex:
avrdude: input file can_testprogram.hex auto detected as Intel Hex
avrdude: input file can_testprogram.hex contains 1102 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 3.87s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0x0c != 0xff
avrdude: verification error; content mismatch
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as FF
avrdude: safemode: lfuse changed! Was 0, and is now ff
Would you like this fuse to be changed back? [y/n] y
^C
Da ich die Fuse bits nicht wissentliche geändert habe, dachte ich mal, ich beantworte das ganze mit "Yes", da ich mir dachte, dass es sich vielleicht um einen Fehler gehandelt hat, der somit wieder behoben wird.
Leider hat avrdude dann gar nicht mehr reagiert, weswegen ich das ganze nach ein paar Minuten abgebrochen habe.
Ich hab speziell von Fuse bits gar keine Ahnung. Mir ist nur bekannt, dass man damit bei falschem Umgang den Controller unbrauchbar machen kann.
Da mein Controller jetzt leider nichts mehr macht hab ich ein bischen Angst, dass das nun jetzt auch bei mir der Fall ist...
Programmieren lässt er sich noch ohne Probleme, das Programm macht nur leider nichts.
Beim Googlen hab ich zwar Fälle gefunden bei denen auch diese Frage gestellt wurde, aber ohne einfrieren des Programm im Anschluss.
Gibt es eine Möglichkeit das wieder hin zu kriegen? Ich weiß leider auch nicht welche Informationen dafür relevant sind, werde aber gerne alles geforderte posten.
Gruß,
toti
Hubert.G
28.02.2011, 11:04
Wenn du den Kontroller noch programmieren kannst dann solltest du auch noch die Fuses abfragen können. Was steht denn da drinnen?
totix800
28.02.2011, 11:13
Hi,
also avrdude gibt mittels:
avrdude -p atmega32 -c avr910 -P /dev/ttyUSB0 -v -U lfuse:r:-:i -F
folgendes aus:
avrdude -p atmega32 -c avr910 -P /dev/ttyUSB0 -v -U lfuse:r:-:i -F
avrdude: Version 5.10, compiled on Jun 29 2010 at 03:44:14
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/home/toti/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyUSB0
Using Programmer : avr910
avr910_devcode (avrdude.conf) : 0x72
AVR Part : ATMEGA32
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 4 10 64 0 no 1024 4 0 9000 9000 0xff 0xff
flash 33 6 64 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
lock 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
calibration 0 0 0 0 no 4 0 0 0 0 0x00 0x00
Programmer Type : avr910
Description : Atmel Low Cost Serial Programmer
Found programmer: Id = "AVR ISP"; type = S
Software Version = 2.5; Hardware Version = 2.0
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize = 8 bytes.
Programmer supports the following devices:
Device code: 0x01 = (unknown)
Device code: 0x02 = (unknown)
Device code: 0x03 = (unknown)
Device code: 0x04 = (unknown)
Device code: 0x05 = (unknown)
Device code: 0x06 = (unknown)
Device code: 0x07 = (unknown)
Device code: 0x08 = (unknown)
Device code: 0x09 = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0b = (unknown)
Device code: 0x0c = (unknown)
Device code: 0x0d = (unknown)
Device code: 0x0e = (unknown)
Device code: 0x0f = (unknown)
Device code: 0x10 = (unknown)
Device code: 0x11 = (unknown)
Device code: 0x12 = (unknown)
Device code: 0x13 = AT90S1200
Device code: 0x14 = (unknown)
Device code: 0x15 = (unknown)
Device code: 0x16 = (unknown)
Device code: 0x17 = (unknown)
Device code: 0x18 = (unknown)
Device code: 0x19 = (unknown)
Device code: 0x1a = (unknown)
Device code: 0x1b = (unknown)
Device code: 0x1c = (unknown)
Device code: 0x1d = (unknown)
Device code: 0x1e = (unknown)
Device code: 0x1f = (unknown)
Device code: 0x20 = ATtiny84
Device code: 0x21 = (unknown)
Device code: 0x22 = (unknown)
Device code: 0x23 = (unknown)
Device code: 0x24 = (unknown)
Device code: 0x25 = (unknown)
Device code: 0x26 = (unknown)
Device code: 0x27 = (unknown)
Device code: 0x28 = AT90S4414
Device code: 0x29 = (unknown)
Device code: 0x2a = (unknown)
Device code: 0x2b = (unknown)
Device code: 0x2c = (unknown)
Device code: 0x2d = (unknown)
Device code: 0x2e = (unknown)
Device code: 0x2f = (unknown)
Device code: 0x30 = AT90S4433
Device code: 0x31 = (unknown)
Device code: 0x32 = (unknown)
Device code: 0x33 = (unknown)
Device code: 0x34 = AT90S2333
Device code: 0x35 = (unknown)
Device code: 0x36 = (unknown)
Device code: 0x37 = (unknown)
Device code: 0x38 = AT90S8515
Device code: 0x39 = (unknown)
Device code: 0x3a = ATMEGA8515
Device code: 0x3b = (unknown)
Device code: 0x3c = (unknown)
Device code: 0x3d = (unknown)
Device code: 0x3e = (unknown)
Device code: 0x3f = (unknown)
Device code: 0x40 = (unknown)
Device code: 0x41 = ATMEGA103
Device code: 0x42 = (unknown)
Device code: 0x43 = ATMEGA128
Device code: 0x44 = (unknown)
Device code: 0x45 = ATMEGA64
Device code: 0x46 = (unknown)
Device code: 0x47 = (unknown)
Device code: 0x48 = (unknown)
Device code: 0x49 = (unknown)
Device code: 0x4a = (unknown)
Device code: 0x4b = (unknown)
Device code: 0x4c = AT90S2343
Device code: 0x4d = (unknown)
Device code: 0x4e = (unknown)
Device code: 0x4f = (unknown)
Device code: 0x50 = (unknown)
Device code: 0x51 = (unknown)
Device code: 0x52 = (unknown)
Device code: 0x53 = (unknown)
Device code: 0x54 = (unknown)
Device code: 0x55 = ATtiny12
Device code: 0x56 = ATtiny15
Device code: 0x57 = (unknown)
Device code: 0x58 = (unknown)
Device code: 0x59 = (unknown)
Device code: 0x5a = (unknown)
Device code: 0x5b = (unknown)
Device code: 0x5c = (unknown)
Device code: 0x5d = (unknown)
Device code: 0x5e = ATtiny2313
Device code: 0x5f = (unknown)
Device code: 0x60 = ATMEGA161
Device code: 0x61 = (unknown)
Device code: 0x62 = (unknown)
Device code: 0x63 = ATMEGA162
Device code: 0x64 = ATMEGA163
Device code: 0x65 = (unknown)
Device code: 0x66 = (unknown)
Device code: 0x67 = (unknown)
Device code: 0x68 = AT90S8535
Device code: 0x69 = ATMEGA8535
Device code: 0x6a = (unknown)
Device code: 0x6b = (unknown)
Device code: 0x6c = AT90S4434
Device code: 0x6d = (unknown)
Device code: 0x6e = (unknown)
Device code: 0x6f = (unknown)
Device code: 0x70 = (unknown)
Device code: 0x71 = (unknown)
Device code: 0x72 = ATMEGA32
Device code: 0x73 = (unknown)
Device code: 0x74 = ATMEGA6450
Device code: 0x75 = ATMEGA6490
Device code: 0x76 = ATMEGA8
Device code: 0x77 = (unknown)
Device code: 0x78 = ATMEGA169
Device code: 0x79 = (unknown)
Device code: 0x7a = (unknown)
Device code: 0x7b = (unknown)
Device code: 0x7c = (unknown)
Device code: 0x7d = (unknown)
Device code: 0x7e = (unknown)
Device code: 0x7f = (unknown)
avrdude: avr910_devcode selected: 0x01
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.06s
avrdude: Device signature = 0xffffff
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATMEGA32 is 1E 95 02
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as FF
avrdude: reading lfuse memory:
Reading | ################################################## | 100% 0.01s
avrdude: writing output file "<stdout>"
:01000000FF00
:00000001FF
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as FF
avrdude: safemode: Fuses OK
avrdude done. Thank you.
Hubert.G
28.02.2011, 13:05
Hier steht es doch
avrdude: Device signature = 0xffffff
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATMEGA32 is 1E 95 02
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as FF
avrdude: reading lfuse memory:
Es wird nichts gelesen.
Sieht so aus als würde keine Verbindung zustande kommen.
totix800
28.02.2011, 13:07
Mhhh, also ich hab noch einen anderen atmega32 hier, der lässt sich ohne Probleme programmieren. Könnte es sein, dass ich mir ausversehen den ISP deaktiviert habe?
Hubert.G
28.02.2011, 13:33
Eher nicht, ein sehr oft vorkommender Fehler ist das Umschalten auf ext.Clock.
Probier mal einen externen Takt auf XTAL1 zu legen.
totix800
28.02.2011, 13:37
Da ich das RN-Control Board benutze habe ich doch automatisch einen 16 Mhz Quarz betriebsbereit oder?
Hubert.G
28.02.2011, 13:46
Ja, aber nur wenn die Fuses im Kontroller richtig eingestellt sind.
Wenn auf ext. Clock gestellt ist, erwartet der Kontroller einen Takt auf XTAL1.
Der Oszillator, der den 16MHz Quarz benötigt, ist dann nicht aktiv.
totix800
28.02.2011, 16:21
ok, wo bekomme ich denn einen externen Takt her? Kann ich den irgendwie von dem funktionsfähigen atmega32 abzweigen? Geht das generell über irgendeinen PIN oder muss ich dafür einen Timer verwenden?
Hubert.G
28.02.2011, 18:28
Der Mega32 hat soviel ich weiss keinen Taktausgang. Du kannst einen Quarz verwenden, CKOPT in den Fuses aktivieren und den Takt an XTAL2 abnehmen.
Ansonst in der while eine Port togglen.
Da ich das RN-Control Board benutze habe ich doch automatisch einen 16 Mhz Quarz betriebsbereit oder?
Zumindest die neueren RN_Control haben eigentlich einen Bootloader so das sie über RS232 Programmiert werden können.
Der ist allerdings in der Regel "Wech" wenn der Chip über ISP programmiert wird........
Mit der Ausgabe von Deinem Brenner komme (ich) nicht klar, ich benutze AVR Studio da bekomme ich die Fuse Einstellungen in Klartext.
Mit einem Datenblatt sollte man aber finden können was und Wo gesetzt sein sollte.
Gruß Richard
totix800
02.03.2011, 16:46
Hi,
also ich hab jetzt mal ein bischen rumprobiert und mittels des Online fuse calculator:
http://www.engbedded.com/fusecalc/
CKOPT bei meinem funktionierenden mega32 aktiviert und auf externen Quarz umgestellt. Ich hab dann versucht das Signal des funktionierenden von XTAL2 auf XTAL1 des anderen zu legen und einfach mal ein Programm zu überspielen, dass einen PORT auf Output stellt. Leider kommt da nichts.
Ich hab aber auch einfach mal interessehalber mit avrdude die fuses des funktionierenden ausgelesen und so wie ich das sehe, kommt da genau das selbe raus wie bei dem anderen. Das würde darauf schließen, dass sie sich mit dem Programmer nicht richtig auslesen lassen oder?
avrdude -p atmega32 -c avr910 -P /dev/ttyUSB0 -v -U lfuse:r:-:i -F
avrdude: Version 5.10, compiled on Jun 29 2010 at 03:44:14
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/home/toti/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyUSB0
Using Programmer : avr910
avr910_devcode (avrdude.conf) : 0x72
AVR Part : ATMEGA32
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 4 10 64 0 no 1024 4 0 9000 9000 0xff 0xff
flash 33 6 64 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
lock 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
calibration 0 0 0 0 no 4 0 0 0 0 0x00 0x00
Programmer Type : avr910
Description : Atmel Low Cost Serial Programmer
Found programmer: Id = "AVR ISP"; type = S
Software Version = 2.5; Hardware Version = 2.0
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize = 512 bytes.
Programmer supports the following devices:
Device code: 0x01 = (unknown)
Device code: 0x02 = (unknown)
Device code: 0x03 = (unknown)
Device code: 0x04 = (unknown)
Device code: 0x05 = (unknown)
Device code: 0x06 = (unknown)
Device code: 0x07 = (unknown)
Device code: 0x08 = (unknown)
Device code: 0x09 = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0b = (unknown)
Device code: 0x0c = (unknown)
Device code: 0x0d = (unknown)
Device code: 0x0e = (unknown)
Device code: 0x0f = (unknown)
Device code: 0x10 = (unknown)
Device code: 0x11 = (unknown)
Device code: 0x12 = (unknown)
Device code: 0x13 = AT90S1200
Device code: 0x14 = (unknown)
Device code: 0x15 = (unknown)
Device code: 0x16 = (unknown)
Device code: 0x17 = (unknown)
Device code: 0x18 = (unknown)
Device code: 0x19 = (unknown)
Device code: 0x1a = (unknown)
Device code: 0x1b = (unknown)
Device code: 0x1c = (unknown)
Device code: 0x1d = (unknown)
Device code: 0x1e = (unknown)
Device code: 0x1f = (unknown)
Device code: 0x20 = ATtiny84
Device code: 0x21 = (unknown)
Device code: 0x22 = (unknown)
Device code: 0x23 = (unknown)
Device code: 0x24 = (unknown)
Device code: 0x25 = (unknown)
Device code: 0x26 = (unknown)
Device code: 0x27 = (unknown)
Device code: 0x28 = AT90S4414
Device code: 0x29 = (unknown)
Device code: 0x2a = (unknown)
Device code: 0x2b = (unknown)
Device code: 0x2c = (unknown)
Device code: 0x2d = (unknown)
Device code: 0x2e = (unknown)
Device code: 0x2f = (unknown)
Device code: 0x30 = AT90S4433
Device code: 0x31 = (unknown)
Device code: 0x32 = (unknown)
Device code: 0x33 = (unknown)
Device code: 0x34 = AT90S2333
Device code: 0x35 = (unknown)
Device code: 0x36 = (unknown)
Device code: 0x37 = (unknown)
Device code: 0x38 = AT90S8515
Device code: 0x39 = (unknown)
Device code: 0x3a = ATMEGA8515
Device code: 0x3b = (unknown)
Device code: 0x3c = (unknown)
Device code: 0x3d = (unknown)
Device code: 0x3e = (unknown)
Device code: 0x3f = (unknown)
Device code: 0x40 = (unknown)
Device code: 0x41 = ATMEGA103
Device code: 0x42 = (unknown)
Device code: 0x43 = ATMEGA128
Device code: 0x44 = (unknown)
Device code: 0x45 = ATMEGA64
Device code: 0x46 = (unknown)
Device code: 0x47 = (unknown)
Device code: 0x48 = (unknown)
Device code: 0x49 = (unknown)
Device code: 0x4a = (unknown)
Device code: 0x4b = (unknown)
Device code: 0x4c = AT90S2343
Device code: 0x4d = (unknown)
Device code: 0x4e = (unknown)
Device code: 0x4f = (unknown)
Device code: 0x50 = (unknown)
Device code: 0x51 = (unknown)
Device code: 0x52 = (unknown)
Device code: 0x53 = (unknown)
Device code: 0x54 = (unknown)
Device code: 0x55 = ATtiny12
Device code: 0x56 = ATtiny15
Device code: 0x57 = (unknown)
Device code: 0x58 = (unknown)
Device code: 0x59 = (unknown)
Device code: 0x5a = (unknown)
Device code: 0x5b = (unknown)
Device code: 0x5c = (unknown)
Device code: 0x5d = (unknown)
Device code: 0x5e = ATtiny2313
Device code: 0x5f = (unknown)
Device code: 0x60 = ATMEGA161
Device code: 0x61 = (unknown)
Device code: 0x62 = (unknown)
Device code: 0x63 = ATMEGA162
Device code: 0x64 = ATMEGA163
Device code: 0x65 = (unknown)
Device code: 0x66 = (unknown)
Device code: 0x67 = (unknown)
Device code: 0x68 = AT90S8535
Device code: 0x69 = ATMEGA8535
Device code: 0x6a = (unknown)
Device code: 0x6b = (unknown)
Device code: 0x6c = AT90S4434
Device code: 0x6d = (unknown)
Device code: 0x6e = (unknown)
Device code: 0x6f = (unknown)
Device code: 0x70 = (unknown)
Device code: 0x71 = (unknown)
Device code: 0x72 = ATMEGA32
Device code: 0x73 = (unknown)
Device code: 0x74 = ATMEGA6450
Device code: 0x75 = ATMEGA6490
Device code: 0x76 = ATMEGA8
Device code: 0x77 = (unknown)
Device code: 0x78 = ATMEGA169
Device code: 0x79 = (unknown)
Device code: 0x7a = (unknown)
Device code: 0x7b = (unknown)
Device code: 0x7c = (unknown)
Device code: 0x7d = (unknown)
Device code: 0x7e = (unknown)
Device code: 0x7f = (unknown)
avrdude: avr910_devcode selected: 0x01
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.06s
avrdude: Device signature = 0xffffff
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATMEGA32 is 1E 95 02
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as FF
avrdude: reading lfuse memory:
Reading | ################################################## | 100% 0.01s
avrdude: writing output file "<stdout>"
:01000000FF00
:00000001FF
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as FF
avrdude: safemode: Fuses OK
avrdude done. Thank you.
Was ich auch noch komisch finde, dass ich immer den Befehl -F benutzen muss, weil scheinbar die Signatur des megas nicht stimmt. Ist das ein Fehler? Ohne Force Parameter sieht der Output so aus:
avrdude -p atmega32 -c avr910 -P /dev/ttyUSB0 -v -U lfuse:r:-:i
avrdude: Version 5.10, compiled on Jun 29 2010 at 03:44:14
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/home/toti/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyUSB0
Using Programmer : avr910
avr910_devcode (avrdude.conf) : 0x72
AVR Part : ATMEGA32
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 4 10 64 0 no 1024 4 0 9000 9000 0xff 0xff
flash 33 6 64 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
lock 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
calibration 0 0 0 0 no 4 0 0 0 0 0x00 0x00
Programmer Type : avr910
Description : Atmel Low Cost Serial Programmer
Found programmer: Id = "AVR ISP"; type = S
Software Version = 2.5; Hardware Version = 2.0
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize = 8 bytes.
Programmer supports the following devices:
Device code: 0x01 = (unknown)
Device code: 0x02 = (unknown)
Device code: 0x03 = (unknown)
Device code: 0x04 = (unknown)
Device code: 0x05 = (unknown)
Device code: 0x06 = (unknown)
Device code: 0x07 = (unknown)
Device code: 0x08 = (unknown)
Device code: 0x09 = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0b = (unknown)
Device code: 0x0c = (unknown)
Device code: 0x0d = (unknown)
Device code: 0x0e = (unknown)
Device code: 0x0f = (unknown)
Device code: 0x10 = (unknown)
Device code: 0x11 = (unknown)
Device code: 0x12 = (unknown)
Device code: 0x13 = AT90S1200
Device code: 0x14 = (unknown)
Device code: 0x15 = (unknown)
Device code: 0x16 = (unknown)
Device code: 0x17 = (unknown)
Device code: 0x18 = (unknown)
Device code: 0x19 = (unknown)
Device code: 0x1a = (unknown)
Device code: 0x1b = (unknown)
Device code: 0x1c = (unknown)
Device code: 0x1d = (unknown)
Device code: 0x1e = (unknown)
Device code: 0x1f = (unknown)
Device code: 0x20 = ATtiny84
Device code: 0x21 = (unknown)
Device code: 0x22 = (unknown)
Device code: 0x23 = (unknown)
Device code: 0x24 = (unknown)
Device code: 0x25 = (unknown)
Device code: 0x26 = (unknown)
Device code: 0x27 = (unknown)
Device code: 0x28 = AT90S4414
Device code: 0x29 = (unknown)
Device code: 0x2a = (unknown)
Device code: 0x2b = (unknown)
Device code: 0x2c = (unknown)
Device code: 0x2d = (unknown)
Device code: 0x2e = (unknown)
Device code: 0x2f = (unknown)
Device code: 0x30 = AT90S4433
Device code: 0x31 = (unknown)
Device code: 0x32 = (unknown)
Device code: 0x33 = (unknown)
Device code: 0x34 = AT90S2333
Device code: 0x35 = (unknown)
Device code: 0x36 = (unknown)
Device code: 0x37 = (unknown)
Device code: 0x38 = AT90S8515
Device code: 0x39 = (unknown)
Device code: 0x3a = ATMEGA8515
Device code: 0x3b = (unknown)
Device code: 0x3c = (unknown)
Device code: 0x3d = (unknown)
Device code: 0x3e = (unknown)
Device code: 0x3f = (unknown)
Device code: 0x40 = (unknown)
Device code: 0x41 = ATMEGA103
Device code: 0x42 = (unknown)
Device code: 0x43 = ATMEGA128
Device code: 0x44 = (unknown)
Device code: 0x45 = ATMEGA64
Device code: 0x46 = (unknown)
Device code: 0x47 = (unknown)
Device code: 0x48 = (unknown)
Device code: 0x49 = (unknown)
Device code: 0x4a = (unknown)
Device code: 0x4b = (unknown)
Device code: 0x4c = AT90S2343
Device code: 0x4d = (unknown)
Device code: 0x4e = (unknown)
Device code: 0x4f = (unknown)
Device code: 0x50 = (unknown)
Device code: 0x51 = (unknown)
Device code: 0x52 = (unknown)
Device code: 0x53 = (unknown)
Device code: 0x54 = (unknown)
Device code: 0x55 = ATtiny12
Device code: 0x56 = ATtiny15
Device code: 0x57 = (unknown)
Device code: 0x58 = (unknown)
Device code: 0x59 = (unknown)
Device code: 0x5a = (unknown)
Device code: 0x5b = (unknown)
Device code: 0x5c = (unknown)
Device code: 0x5d = (unknown)
Device code: 0x5e = ATtiny2313
Device code: 0x5f = (unknown)
Device code: 0x60 = ATMEGA161
Device code: 0x61 = (unknown)
Device code: 0x62 = (unknown)
Device code: 0x63 = ATMEGA162
Device code: 0x64 = ATMEGA163
Device code: 0x65 = (unknown)
Device code: 0x66 = (unknown)
Device code: 0x67 = (unknown)
Device code: 0x68 = AT90S8535
Device code: 0x69 = ATMEGA8535
Device code: 0x6a = (unknown)
Device code: 0x6b = (unknown)
Device code: 0x6c = AT90S4434
Device code: 0x6d = (unknown)
Device code: 0x6e = (unknown)
Device code: 0x6f = (unknown)
Device code: 0x70 = (unknown)
Device code: 0x71 = (unknown)
Device code: 0x72 = ATMEGA32
Device code: 0x73 = (unknown)
Device code: 0x74 = ATMEGA6450
Device code: 0x75 = ATMEGA6490
Device code: 0x76 = ATMEGA8
Device code: 0x77 = (unknown)
Device code: 0x78 = ATMEGA169
Device code: 0x79 = (unknown)
Device code: 0x7a = (unknown)
Device code: 0x7b = (unknown)
Device code: 0x7c = (unknown)
Device code: 0x7d = (unknown)
Device code: 0x7e = (unknown)
Device code: 0x7f = (unknown)
avrdude: avr910_devcode selected: 0x72
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.06s
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.
Gruß,
toti
Hubert.G
02.03.2011, 16:56
Wenn die Signatur nicht richtig erkannt wird, dann ist irgendwo der Wurm drinnen. Wenn du dann trotzdem Programmierst dann kann allerhand Unsinn im Kontroller stehen.
Hast du ein anderes Board zum Programmieren? Damit du testen kannst ob der Programmer defekt ist oder das Board.
totix800
02.03.2011, 17:08
Also das er die Signatur nicht richtig erkannt hat war schon immer so. Ich musste immer per -F forcen. Ich hab den Programmer mit zwei verschiedenen megas benutzt und hab beide ne ganze weile damit programmiert, bis der eine halt nicht mehr ging...Bei beiden wurde die Signatur nicht erkannt.
Es kommt auch öfter vor, dass ich das Programm zwei mal hintereinander übertragen muss, weil sonst nichts passiert.
Hallo,
versuche doch einmal langsamer zu übertragen.
Wenn ich Fuses übertrage, dann noch mit "-B 10" in der Kommandozeile.
Ich verwende den USBasp-Adapter.
Ein frischer Atmega kommt anfangs bei normaler Übertragungsgeschwindigkeit irgendwie nicht mit.
Nur wenn ich noch -B 10 anfüge, funktioniert das.
Wenn die Fuses dann einmal entsprechend gesetzt wurden, kann der Atmega auch die normale Geschwindigkeit über ISP vertragen.
Grüße,
Bernhard
Besserwessi
02.03.2011, 18:17
Wenn die Signatur nicht richtig erkannt wird, heißt dass das die Verbindung über die ISP Schnittstelle nicht sicher funktioniert. Da man wohl was einigermaßen sinnvolles Auslesen kann und ggf. auch schreiben kann, ist es hier wohl so das es gerade an der Grenze ist. In diesem Fall sollte man erstmal klären woran das liegt.
Bevor man keine zuverlässige Verbindung hat, sollte man nicht auf den µC schreiben. Es kann dann nämlich auch mal versehentlich was anderes als geplant geschrieben werden. Schreiben mit einer schlechten Verbindung ist riskant. Wenn man ganz viel Pech hat, kann sogar schon beim "lesen" was passieren - da sind die Gefahren aber meist kleiner.
Die Option -F sollte man auch mit viel Vorsicht (z.B. für neuen noch nicht unterstützten µC Typ) nutzen. Da ist immer ein Risiko dabei, selbst wenn die Verbindung sonst stabil läuft.
totix800
02.03.2011, 18:33
Mhh, also an der verkabelung sollte es eigentlich nicht liegen, das ist son wannenstecker, da müsste das problem schon direkt auf der platine vom programmer liegen. Oder auf dem rn boad.
BMS hat ja schon dir geschwindigkeit angesprochen, mein ihr das könnte etwas bewirken? Was genau bringt -B 10? Hab leider grade keinen zugang zur man page von avrdude.
Gruß,
toti
-B bitclock
Specify the bit clock period for the JTAG interface or the ISP clock (JTAG ICE only). The value is a floating-point number in microseconds. The default value of the JTAG ICE results in about 1 microsecond bit clock period, suitable for target MCUs running at 4 MHz clock and above. Unlike certain parameters in the STK500, the JTAG ICE resets all its parameters to default values when the programming software signs off from the ICE, so for MCUs running at lower clock speeds, this parameter must be specified on the command-line.
Quelle: AVRDUDE: 2.1 Option Descriptions (http://www.nongnu.org/avrdude/user-manual/avrdude_4.html)
-B 10 bedeutet also 10µSekunden Taktperiode (=100kHz ISP Clock maximal).
Vielleicht muss es auch noch langsamer sein, z.B. wären -B 100 ja 100µSekunden, also 10kHz ISP Clock maximal, da MUSS es ja dann funktionieren, sonst ist etwas am Programmieradapter oder der Kabelverbindung faul !
Also wie schon geschrieben, Fuses übertragen bei neu gekauften Atmegas ging bei mir (über USBasp) NUR mit dem Zusatz "-B 10" in der Kommandozeile von avrdude.
Grüße,
Bernhard
Powered by vBulletin® Version 4.2.5 Copyright ©2024 Adduco Digital e.K. und vBulletin Solutions, Inc. Alle Rechte vorbehalten.