system
August 11, 2010, 4:12pm
1
Moin Leute,
ich bins mal wieder.
Ich würde gerne einen Attiny 85V mit dem Arduino flashen. Leider hab ich keine Ahnung wie ich das genau machen soll. Tante Google liefert auch nur irgendwelche Anleitungen zum ätzen und sonst nur irwas um nen Atmega168 mit dem Arduino Bootloader zu flashen.
Ich hoffe irwer hat Ahnung..
Gruß Jonas
Also was Du willst ist einen Arduino als Programmer zu benutzen. Die Leute mit Ahnung haben eine FAQ geschrieben
AVR-Tutorial: Equipment – Mikrocontroller.net .
Wie man einen Arduino zu einem ISP macht steht hier:
Davon abgesehen wäre mir die Zeit und der Frust zuviel. Habe ich aber schon hier breitgetreten: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1266336058/14#14 .
Wenn es Dir aber um den Lerneffekt geht und Du genug Zeit hast: Versuch macht klug. Du kannst dann ja hinterher immer noch einen ISP kaufen
Udo
system
August 11, 2010, 8:52pm
3
Vielen Dank, naja der Lerneffekt muss warten, würde gerne den Chip noch heute brennen. Ich schau mir das mal an..^^
system
August 13, 2010, 11:08pm
4
So, nach ewigem probieren passiert immer noch nichts. Ich glaube der CHip will nicht geflasht werden. Kann mir irgendjemand helfen? und sagen wie ich so was richtig mache?
system
August 14, 2010, 12:12am
5
seufz
Ein richtiger "Programmer" mit USB Anschluss kostet bei verschiedenen deutschen Quellen zwischen 14,50 und 16,50; zuverlässige Chinesen liefern auch schon für 2 Euro weniger... Dauert natürlich ein paar Tage.
Was du brauchst, ist erst mal ein Checkprogramm für die Fuses; Du solltest Dich am besten mit AVRdude anfreunden.... Da gibt es auch Tutorials..
Andere freundlichere Möglichkeiten wären über Bascom STK500 oder aber mit dem sehr schönen Programmer Tool vom myAVR. Das kann man dort runterladen und es funktioniert nicht nur für die dortigen Boards. Einstellen auf STK500v1.
system
August 14, 2010, 12:16am
6
Mir fällt gerade ein: Eine häufige Fabrikeinstellung von Chips ist 1MHz /intern. Das ist für manche Programmer einfach zu langsam, die muss man für den ersten Programmiervorgang auf Low Speed einstellen. Alllerdings sollte die STK500 Arduino Software damit keine Probleme haben...
system
August 14, 2010, 12:41am
7
system
August 14, 2010, 8:47am
8
Wow okay, danke..
Wenn es dir hilft kann ich dir mal ne Fehlermeldung posten, vllt hilft dir das
system
August 14, 2010, 9:02am
9
C:\Users\Jonas>avrdude -p t85 -c avrisp -b19200 -P com7 -B10 -F -v -U flash:w:C:
\firmwarev1.2\tvbgone.hex:a
avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"
Using Port : com7
Using Programmer : avrisp
Overriding Baud Rate : 19200
Setting bit clk period : 10.0
AVR Part : ATtiny85
Chip Erase delay : 4500 us
PAGEL : P00
BS2 : P00
RESET disposition : possible i/o
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 Max
W ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
eeprom 65 6 4 0 no 512 4 0 4000 45
00 0xff 0xff
flash 65 6 32 0 yes 8192 64 128 4500 45
00 0xff 0xff
signature 0 0 0 0 no 3 0 0 0
0 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
calibration 0 0 0 0 no 2 0 0 0
0 0x00 0x00
Programmer Type : STK500
Description : Atmel AVR ISP
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: please define PAGEL and BS2 signals in the configuration file for part
ATtiny85
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.13s
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATtiny85 is 1E 93 0B
avrdude: safemode: Verify error - unable to read lfuse properly. Programmer may
not be reliable.
avrdude: safemode: To protect your AVR the programming will be aborted
avrdude done. Thank you.
C:\Users\Jonas>avrdude -p t85 -c avrisp -b19200 -P com7 -B10 -F -v -U flash:w:C:
\firmwarev1.2\tvbgone.hex:a
avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"
Using Port : com7
Using Programmer : avrisp
Overriding Baud Rate : 19200
Setting bit clk period : 10.0
AVR Part : ATtiny85
Chip Erase delay : 4500 us
PAGEL : P00
BS2 : P00
RESET disposition : possible i/o
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 Max
W ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
eeprom 65 6 4 0 no 512 4 0 4000 45
00 0xff 0xff
flash 65 6 32 0 yes 8192 64 128 4500 45
00 0xff 0xff
signature 0 0 0 0 no 3 0 0 0
0 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
calibration 0 0 0 0 no 2 0 0 0
0 0x00 0x00
Programmer Type : STK500
Description : Atmel AVR ISP
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: please define PAGEL and BS2 signals in the configuration file for part
ATtiny85
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.13s
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATtiny85 is 1E 93 0B
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as FF
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: current erase-rewrite cycle count is -65536 (if being tracked)
avrdude: erasing chip
avrdude: please define PAGEL and BS2 signals in the configuration file for part
ATtiny85
avrdude: reading input file "C:\firmwarev1.2\tvbgone.hex"
avrdude: input file C:\firmwarev1.2\tvbgone.hex auto detected as Intel Hex
avrdude: writing flash (8164 bytes):
Writing | ################################################## | 100% 13.34s
avrdude: 8164 bytes of flash written
avrdude: verifying flash memory against C:\firmwarev1.2\tvbgone.hex:
avrdude: load data flash data from input file C:\firmwarev1.2\tvbgone.hex:
avrdude: input file C:\firmwarev1.2\tvbgone.hex auto detected as Intel Hex
avrdude: input file C:\firmwarev1.2\tvbgone.hex contains 8164 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 14.65s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0x1a != 0xff
avrdude: verification error; content mismatch
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as FF
avrdude: safemode: Verify error - unable to read efuse properly. Programmer may
not be reliable.
avrdude: safemode: Verify error - unable to read lfuse properly. Programmer may
not be reliable.
avrdude: safemode: Sorry, reading back fuses was unreliable. I have given up and
exited programming mode
avrdude done. Thank you.
Die bekomm ich jetzt seit neustem...gestern lief das aber noch mit den Fuses...
Also ich würde erst einmal probieren ob es möglich ist den anderen Arduino zu flashen. Wenn ja wäre schon mal klar, dass der ISP tut wie er soll.
Udo
system
August 14, 2010, 9:35am
13
Meinst du auf den anderen Arduino nen Sketch über den ISP laden?
Genau das. Sowas geht auch. Wer einen ISP hat braucht gar keinen Bootloader. Man muss nur die boards.txt anpassen.
Udo
system
August 14, 2010, 9:56am
15
Okay, ich muss nur schauen wie das funktioniert.
system
August 14, 2010, 10:07am
16
Die vorliegenden Probleme sollte man nicht mit "versuch mal zu flashen" angehen. Erst mal die Fuses auslesen! Da geht nix bei kaputt. Wenn das nicht geht, dann geht auch kein flashen!!
Eine Signatur von 00 deutet auf ein Problem im Chip hin; eine Signatur von FF eher auf ein Problem in der Spannungsversorgung.
P.S. Natürlich kann man auch im Arduino jeden Chip mit einem "ISP" programmieren statt über den Bootloader. Hier wurde schon auf einen Thread verwiesen. Die Einstellungen bei mir für einen preiswerten USBasp programmer (in der boards.txt Datei) sind:
mega8mASP.name=ATmega8mUSBasp
mega8mASP.upload.protocol=usbasp
mega8mASP.upload.maximum_size=8196
mega8mASP.upload.using=USBasp
mega8mASP.build.mcu=atmega8
mega8mASP.build.f_cpu=8000000L
mega8mASP.build.core=arduino
Ich nehme gerne das USBasp Protokoll, weil es keinen virtuellen COM Port belegt...
Ergänzung:
Das war für einen Chip, der bei 8MHz internem Takt läuft... Da gibt es noch einiges zu berücksichtigen, ich lebe damit; man könnte aber auch eine Arduinocore anpassen. Lilipad ist leider nur für einen 168 verfügbar.
Ansonsten muss es natürlich
mega8mASP.build.f_cpu=16000000L
heißen.
system
August 14, 2010, 10:20am
17
C:\Users\Jonas>avrdude -p m328p -c avrisp -P com7 -b 19200 -F -U flash:w:Blink.h
ex
avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51
avrdude done. Thank you.
Die Meldung kommt mein uploaden...Ich habs mit der Variante von Ladyada versucht (Arduino Hacks -> Upload sketches with AVRDUDE )
Dann werd ich jetzt mal die Fuses auslesen
system
August 14, 2010, 11:28am
18
Wie werden denn die Fuses ausgelesen? Bekomme das irgendwie nicht hin... -.-
EDIT:
C:\Users\Jonas>avrdude -P com7 -p t85 -c avrisp -b19200 -v -B10 -F -U flash:w:C:
\firmwarev1.2\tvbgone.hex:a
avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"
Using Port : com7
Using Programmer : avrisp
Overriding Baud Rate : 19200
Setting bit clk period : 10.0
AVR Part : ATtiny85
Chip Erase delay : 4500 us
PAGEL : P00
BS2 : P00
RESET disposition : possible i/o
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 Max
W ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
eeprom 65 6 4 0 no 512 4 0 4000 45
00 0xff 0xff
flash 65 6 32 0 yes 8192 64 128 4500 45
00 0xff 0xff
signature 0 0 0 0 no 3 0 0 0
0 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
calibration 0 0 0 0 no 2 0 0 0
0 0x00 0x00
Programmer Type : STK500
Description : Atmel AVR ISP
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: please define PAGEL and BS2 signals in the configuration file for part
ATtiny85
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.13s
avrdude: Device signature = 0x00ffff
avrdude: Expected signature for ATtiny85 is 1E 93 0B
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: Verify error - unable to read efuse properly. Programmer may
not be reliable.
avrdude: safemode: To protect your AVR the programming will be aborted
avrdude done. Thank you.
So sah das grad alles aus, vllt hilft ja das weiter...
system
August 14, 2010, 12:16pm
19
Lass doch das "flashen" erst mal weg! Wahrscheinlich ist der 85er dadurch eh recht undefiniert geworden ;D
Im -v Modus gibt dir avrdude sowie die fuses und die gelesene signatur aus.
Was du brauchst, ist erst mal eine stabile Programmierumgebung. Du kannst nicht gleichzeitig einen Fehler im target und im set-up suchen!
Also am bestem mal irgendeinen "definierten" Mega8 nehmen, und sehen, was avrdude dazu sagt.
Danach kann man sich dann um dem 85er kümmern.
Sehr richtig. Das ist auch der Grund warum ich immer dazu rate erst einmal mit einem Standard ISP (siehe der andere Thread) zu starten. Manche muessen das aber halt auf die harte Tour lernen
Udo