Tiny24 mit avrdude unter Debian programmieren

#3960658
Lesenswert?

Hallo allerseits,

ich brauche mal ein bischen Starthilfe, um Avrdude unter Debian zum 
Laufen zu bekommen. Ich habe so einen Programmer:
1
http://www.ebay.de/itm/USB-ISP-Programmer-fur-ATMEL-AVR-STK500-ATmega-ATtiny-AT90-Controller-/270955427201
wenn ich ihn anstecke, meldet lsusb diese Zeile:
1
Bus 005 Device 007: ID 16c0:2a9b VOTI

Erstes Problem: ich weiß nicht, welcher Programmer aus der Liste. In 
Frage kämen meiner Meinung nach:

stk500v2 (das steht in der Beschreibung vom Programmer) oder
usbasp (weil es ein USB-Teil ist?)

wie kann ich denn erstmal herausfinden, welchen Programmer ich 
einstellen muss? Und dann habe ich einen Tiny24 angeschlossen, habe also 
probiert:
1
$ avrdude -n -p t24 -n -c stk500v2
2

3
avrdude: stk500v2_command(): command failed
4
avrdude: initialization failed, rc=-1
5
         Double check connections and try again, or use -F to override
6
         this check.
7
...
8

9
$ avrdude -n -p t24 -n -c usbasp
10
avrdude: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc

Dann habe ich bei der zweiten Variante gesehen, dass die Adresse nicht 
übereinstimmt. Also habe ich die /etc/avrdude.conf mit dem Editor 
aufgemacht, in der Annahme, dass ich die Adresse da einstellen kann. 
Aber ich finde die Stelle nicht, wo 16c0:5dc eingestellt ist..

Wie geht es besser? :-)
#3960670
Lesenswert?

Peter II schrieb:
> das sieht doch schon gut aus

Ach das sieht gut aus? :-) Na wenn Du meinst..

Ich habe mal -v eingeschaltet:
1
$ avrdude -n -p t24 -n -c stk500v2 -v
2

3
avrdude: Version 5.11.1, compiled on Oct 18 2011 at 21:17:35
4
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
5
         Copyright (c) 2007-2009 Joerg Wunsch
6

7
         System wide configuration file is "/etc/avrdude.conf"
8
         User configuration file is "/home/rainer/.avrduderc"
9
         User configuration file does not exist or is not a regular file, skipping
10

11
         Using Port                    : /dev/ttyS0
12
         Using Programmer              : stk500v2
13
avrdude: stk500v2_ReceiveMessage(): timeout
14
avrdude: stk500v2_ReceiveMessage(): timeout
15
avrdude: stk500v2_ReceiveMessage(): timeout
16
...
#3960674
Lesenswert?

user schrieb:
> laut
> 
http://www.roboternetz.de/community/threads/43700-AVRDUDE-und-no-name-USB-Progger-unter-Linux
> solltest du mal das hier probieren
>
> avrdude -p tiny24 -c stk500v2 -P /dev/ttyACM0 -v

Ich habe mal in "t24 abgeändert (tiny24 kennt er nicht) - das kommt 
'raus - heißt das- er konnte schon mal die fuses und ie cip id lesen?:
1
$ avrdude -p t24 -c stk500v2 -P /dev/ttyACM0 -v
2

3
avrdude: Version 5.11.1, compiled on Oct 18 2011 at 21:17:35
4
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
5
         Copyright (c) 2007-2009 Joerg Wunsch
6

7
         System wide configuration file is "/etc/avrdude.conf"
8
         User configuration file is "/home/rainer/.avrduderc"
9
         User configuration file does not exist or is not a regular file, skipping
10

11
         Using Port                    : /dev/ttyACM0
12
         Using Programmer              : stk500v2
13
         AVR Part                      : ATtiny24
14
         Chip Erase delay              : 4500 us
15
         PAGEL                         : P00
16
         BS2                           : P00
17
         RESET disposition             : possible i/o
18
         RETRY pulse                   : SCK
19
         serial program mode           : yes
20
         parallel program mode         : yes
21
         Timeout                       : 200
22
         StabDelay                     : 100
23
         CmdexeDelay                   : 25
24
         SyncLoops                     : 32
25
         ByteDelay                     : 0
26
         PollIndex                     : 3
27
         PollValue                     : 0x53
28
         Memory Detail                 :
29

30
                                  Block Poll               Page                       Polled
31
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
32
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
33
           eeprom        65     6     4    0 no        128    4      0  4000  4500 0xff 0xff
34
           flash         65     6    32    0 yes      2048   32     64  4500  4500 0xff 0xff
35
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
36
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
37
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
38
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
39
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
40
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
41

42
         Programmer Type : STK500V2
43
         Description     : Atmel STK500 Version 2.x firmware
44
         Programmer Model: AVRISP
45
         Hardware Version: 15
46
         Firmware Version Master : 2.10
47
         Vtarget         : 0.0 V
48
         SCK period      : 198.6 us
49

50
avrdude: stk500v2_command(): command failed
51
avrdude: initialization failed, rc=-1
52
         Double check connections and try again, or use -F to override
53
         this check.
54

55

56
avrdude done.  Thank you.
Gast #3960681
Lesenswert?

Rainer Unsinn schrieb:
> Kleiner Nachtrag: irgend eine Verbindung gibt es - wenn ich das Kommando
> aufrufe, geht der Tiny in den Reset..

das ist schon mal gut.

avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

das darf nicht passieren. Mit "Double check Connections" ist die 
Verbindung zum Tiny gemeint.
#3960705
Lesenswert?

Also die Verkabelung stimmt (so viel Kabel sind es ja nun nicht, und ich 
habe den ja schon oft so angeschlossen, nur unter Windows..)

Die rote Lampe am Programmer pulsiert (gedimmt) zwischen aus und an.

Ich habe jetzt das Teil noch mal abgezogen und neu angesteckt. Jetzt 
geht es offenbar "etwas besser":
1
$ avrdude -n -p t24 -n -c stk500v2 -v -P /dev/ttyACM0
2

3
avrdude: Version 5.11.1, compiled on Oct 18 2011 at 21:17:35
4
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
5
         Copyright (c) 2007-2009 Joerg Wunsch
6

7
         System wide configuration file is "/etc/avrdude.conf"
8
         User configuration file is "/home/rainer/.avrduderc"
9
         User configuration file does not exist or is not a regular file, skipping
10

11
         Using Port                    : /dev/ttyACM0
12
         Using Programmer              : stk500v2
13
         AVR Part                      : ATtiny24
14
         Chip Erase delay              : 4500 us
15
         PAGEL                         : P00
16
         BS2                           : P00
17
         RESET disposition             : possible i/o
18
         RETRY pulse                   : SCK
19
         serial program mode           : yes
20
         parallel program mode         : yes
21
         Timeout                       : 200
22
         StabDelay                     : 100
23
         CmdexeDelay                   : 25
24
         SyncLoops                     : 32
25
         ByteDelay                     : 0
26
         PollIndex                     : 3
27
         PollValue                     : 0x53
28
         Memory Detail                 :
29

30
                                  Block Poll               Page                       Polled
31
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
32
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
33
           eeprom        65     6     4    0 no        128    4      0  4000  4500 0xff 0xff
34
           flash         65     6    32    0 yes      2048   32     64  4500  4500 0xff 0xff
35
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
36
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
37
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
38
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
39
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
40
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
41

42
         Programmer Type : STK500V2
43
         Description     : Atmel STK500 Version 2.x firmware
44
         Programmer Model: AVRISP
45
         Hardware Version: 15
46
         Firmware Version Master : 2.10
47
         Vtarget         : 0.0 V
48
         SCK period      : 198.6 us
49

50
avrdude: AVR device initialized and ready to accept instructions
51

52
Reading | ################################################## | 100% 0.02s
53

54
avrdude: Device signature = 0x1e910b
55
avrdude: safemode: lfuse reads as 0
56
avrdude: safemode: hfuse reads as DF
57
avrdude: safemode: Verify error - unable to read efuse properly. Programmer may not be reliable.
58
avrdude: safemode: To protect your AVR the programming will be aborted
59

60
avrdude done.  Thank you.
#3960838
Lesenswert?

Also zuverlässig ist die Sache leider nicht.. ich lese fast nie die 
richtige device signature, mal sind die bits verschoben, mal fehlen 
welche und mal bekomme ich überhaupt keine Verbindung usw:
1
$ avrdude -p t24 -c stk500v2 -P /dev/ttyACM0
2

3
avrdude: AVR device initialized and ready to accept instructions
4

5
Reading | ################################################## | 100% 0.02s
6

7
avrdude: Device signature = 0x1e91ff
8
avrdude: Expected signature for ATtiny24 is 1E 91 0B
9
         Double check chip, or use -F to override this check.
10

11
avrdude done.  Thank you.

Ich habe schon einen identischen programmer probiert (daran liegt es 
nicht) und versucht mit -i... delays einzubauen. Wo kann ich noch dran 
drehen, damit die Übertragung stabiler (langsamer) wird?

Verkabelung habe ich mehrfach geprüft..
#3960914
Lesenswert?

Rainer Unsinn schrieb:
> Wo kann ich noch dran
> drehen, damit die Übertragung stabiler (langsamer) wird?

Aus
http://wiki.ctbot.de/index.php/AVR_ISP_Programmer#BlueMP3_bzw._STK200_kompatible_Flasher

"Sollten hier Verbindungsprobleme auftreten so muss man noch die Option 
-B 10 anfügen. Diese Option drosselt die ISP Geschwindigkeit. Nach dem 
Setzen der Fusebits ist dies nicht mehr notwendig."

Mit der Option -b kann man auch noch die Baudrate vorgeben.

Du benutzt avrdude: Version 5.11.1, aktuell ist Version 6.1,
evtl. mal die ausprobieren.
#3961079
Lesenswert?

Ich hatte mal ganz ähnliche Probleme, als ich es irgendwie geschafft 
habe, die Verdrahtung insofern zu verballern, als ich die +5V nicht an 
den AVR gegeben habe. Der Strom über die Datenleitungen war dann genug, 
um den Chip manchmal teilweise aufzuwecken, aber halt in ähnlicher Weise 
unzuverlässig wie hier beschrieben. Ich würde mal messen, was zwischen 
vcc und gnd am Tiny ankommt. Nur sicherheitshalber. :)
#3961190
Lesenswert?

-B10 hat's gebracht, auch mit der Version 5.11! Ich hab die Option nicht 
so für voll genommen, weil es in der Beschreibung um JTAG ging.. jetzt 
ist alles ok, danke an alle!
1
$ avrdude -p t24 -c stk500v2 -P /dev/ttyACM0 -B10
2

3
avrdude: AVR device initialized and ready to accept instructions
4

5
Reading | ################################################## | 100% 0.02s
6

7
avrdude: Device signature = 0x1e910b
8

9
avrdude: safemode: Fuses OK
10

11
avrdude done.  Thank you.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren