Forum: Mikrocontroller und Digitale Elektronik Atmega324PA mit WinAVR - wie muss ich den patch anwenden?


von Claudio (Gast)


Lesenswert?

Hallo Liebe Community

Ich versuche hier einen Atmega324PA (Wichtig, A Typ!)
Mit Eclipse und WinAVR zu programmieren...

Wenn ich den Chip beim Projekt -> Properties -> AVR auswähle,
steht das dieser Typ nicht von AVRDude unterstützt wird.

Nach einigem Googlen hab ich herausgefunden dass man diesen Typ im
Avrdude.conf file bekannt geben muss... Also hab ich dies getan.

Doch auch dannach klappte es nicht. Wenn ich das File umbenenne mekert
er das er das File nicht findet. Somit habe ich also das richtige File 
angepasst.

Hat jemand von euch einen Tipp wie ich hier vorgehen kann?

Danke schonmal :)

von Markus W. (Firma: guloshop.de) (m-w)


Lesenswert?

Claudio schrieb:
> Nach einigem Googlen hab ich herausgefunden dass man diesen Typ im
> Avrdude.conf file bekannt geben muss... Also hab ich dies getan.

Wie? Hast du den Abschnitt des ATmega324 genommen, kopiert und auf den 
ATmega324A angepasst? Falls ja, was genau hast du geändert?

> Doch auch dannach klappte es nicht.

Ahja. Stecker drin? ;-)
Ne, im Ernst, beschreib bitte mal genauer, was nicht klappt. 
Fehlermeldungen? Was sagt avrdude, wenn du -v mit übergibst?

Markus

von Claudio (Gast)


Angehängte Dateien:

Lesenswert?

Danke für deine Antwort :)

Erstmals hier meine verwendeten Versionen:

AvrDude: Datei vom 19.01.2010
WinAVR Paket: 20100110
Eclipse Plugin Version laut EclipseAbout Dialog: 2.4.0.201203041437
Programmer: USBAsp

Markus W. schrieb:
> Wie? Hast du den Abschnitt des ATmega324 genommen, kopiert und auf den
> ATmega324A angepasst? Falls ja, was genau hast du geändert?

Ja hab ich :) Anbei mein gesamtes .conf file.

Meines Wissens ist lediglich eine andere Signatur vorhanden.

Damit ich die Fuses verändern kann, hab ich den 324PA gewählt (wenn ich 
gewählt schreibe, meine ich immer unter [mein-project] -> properties -> 
AVR ) dann habe ich den editor gestartet und meine gewünschten dinge 
zusammen geklickt.

Danach wieder auf 324P geändert und versucht zu Programmieren..

Dann gibts diesen Output:
1
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
2
avrdude: AVR device initialized and ready to accept instructions
3
4
Reading | ################################################## | 100% 0.00s
5
6
avrdude: Device signature = 0x1e9511
7
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
8
         To disable this feature, specify the -D option.
9
avrdude: erasing chip
10
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
11
avrdude: reading input file "BLDC_TestBoard.hex"
12
avrdude: input file BLDC_TestBoard.hex auto detected as Intel Hex
13
avrdude: writing flash (154 bytes):
14
15
Writing | ################################################## | 100% 0.07s
16
17
avrdude: 154 bytes of flash written
18
avrdude: verifying flash memory against BLDC_TestBoard.hex:
19
avrdude: load data flash data from input file BLDC_TestBoard.hex:
20
avrdude: input file BLDC_TestBoard.hex auto detected as Intel Hex
21
avrdude: input file BLDC_TestBoard.hex contains 154 bytes
22
avrdude: reading on-chip flash data:
23
24
Reading | ################################################## | 100% 0.05s
25
26
avrdude: verifying ...
27
avrdude: 154 bytes of flash verified
28
avrdude: reading input file "0xff"
29
avrdude: writing lfuse (1 bytes):
30
31
Writing | ################################################## | 100% 0.00s
32
33
avrdude: 1 bytes of lfuse written
34
avrdude: verifying lfuse memory against 0xff:
35
avrdude: load data lfuse data from input file 0xff:
36
avrdude: input file 0xff contains 1 bytes
37
avrdude: reading on-chip lfuse data:
38
39
Reading | ################################################## | 100% 0.00s
40
41
avrdude: verifying ...
42
avrdude: 1 bytes of lfuse verified
43
avrdude: reading input file "0xfe"
44
avrdude: writing hfuse (1 bytes):
45
46
Writing |  ***failed;  
47
################################################## | 100% 0.06s
48
49
avrdude: 1 bytes of hfuse written
50
avrdude: verifying hfuse memory against 0xfe:
51
avrdude: load data hfuse data from input file 0xfe:
52
avrdude: input file 0xfe contains 1 bytes
53
avrdude: reading on-chip hfuse data:
54
55
Reading | ################################################## | 100% 0.00s
56
57
avrdude: verifying ...
58
avrdude: verification error, first mismatch at byte 0x0000
59
         0xfe != 0xde
60
avrdude: verification error; content mismatch
61
62
avrdude done.  Thank you.
63
64
avrdude finished


Wenn ich unter AVR den Typ bei Atmega324PA belasse und versuche zu 
programmieren, dann kommt diese Meldung: (siehe bild nr1)








hier mein PA Config teil:
1
#------------------------------------------------------------
2
# ATmega324P
3
#------------------------------------------------------------
4
5
# similar to ATmega164P
6
7
part
8
    id               = "m324p";
9
    desc             = "ATMEGA324PA";
10
    has_jtag         = yes;
11
    stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
12
    avr910_devcode   = 0x74;
13
    signature        = 0x1e 0x95 0x11;
14
    pagel            = 0xd7;
15
    bs2              = 0xa0;
16
    chip_erase_delay = 9000;
17
    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
18
                       "x x x x  x x x x    x x x x  x x x x";
19
20
    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
21
                       "x x x x  x x x x    x x x x  x x x x";
22
23
    timeout    = 200;
24
    stabdelay    = 100;
25
    cmdexedelay    = 25;
26
    synchloops    = 32;
27
    bytedelay    = 0;
28
    pollindex    = 3;
29
    pollvalue    = 0x53;
30
    predelay    = 1;
31
    postdelay    = 1;
32
    pollmethod    = 0;
33
34
    pp_controlstack     =
35
        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
36
        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
37
        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
38
        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
39
    hventerstabdelay    = 100;
40
    progmodedelay       = 0;
41
    latchcycles         = 5;
42
    togglevtg           = 1;
43
    poweroffdelay       = 15;
44
    resetdelayms        = 1;
45
    resetdelayus        = 0;
46
    hvleavestabdelay    = 15;
47
    chiperasepulsewidth = 0;
48
    chiperasepolltimeout = 10;
49
    programfusepulsewidth = 0;
50
    programfusepolltimeout = 5;
51
    programlockpulsewidth = 0;
52
    programlockpolltimeout = 5;
53
54
    idr                 = 0x31;
55
    spmcr               = 0x57;
56
    allowfullpagebitstream = no;
57
58
    memory "eeprom"
59
        paged           = no; /* leave this "no" */
60
        page_size       = 4;  /* for parallel programming */
61
        size            = 1024;
62
        min_write_delay = 9000;
63
        max_write_delay = 9000;
64
        readback_p1     = 0xff;
65
        readback_p2     = 0xff;
66
  read            = "  1   0   1   0      0   0   0   0",
67
                          "  0   0   x   x      x a10  a9  a8",
68
                          " a7  a6  a5  a4     a3  a2  a1  a0",
69
                          "  o   o   o   o      o   o   o   o";
70
71
  write           = "  1   1   0   0      0   0   0   0",
72
                          "  0   0   x   x      x a10  a9  a8",
73
                          " a7  a6  a5  a4     a3  a2  a1  a0", 
74
                          "  i   i   i   i      i   i   i   i";
75
76
  loadpage_lo  = "  1   1   0   0      0   0   0   1",
77
        "  0   0   0   0      0   0   0   0",
78
        "  0   0   0   0      0   0  a1  a0",
79
        "  i   i   i   i      i   i   i   i";
80
81
  writepage  = "  1   1   0   0      0   0   1   0",
82
        "  0   0   x   x      x a10  a9  a8",
83
        " a7  a6  a5  a4     a3  a2   0   0",
84
        "  x   x   x   x      x   x   x   x";
85
86
  mode    = 0x41;
87
  delay    = 10;
88
  blocksize  = 128;
89
  readsize  = 256;
90
      ;
91
92
    memory "flash"
93
        paged           = yes;
94
        size            = 32768;
95
        page_size       = 128;
96
        num_pages       = 256;
97
        min_write_delay = 4500;
98
        max_write_delay = 4500;
99
        readback_p1     = 0xff;
100
        readback_p2     = 0xff;
101
        read_lo         = "  0   0   1   0      0   0   0   0",
102
                          "  0 a14 a13 a12    a11 a10  a9  a8",
103
                          " a7  a6  a5  a4     a3  a2  a1  a0",
104
                          "  o   o   o   o      o   o   o   o";
105
106
        read_hi         = "  0   0   1   0      1   0   0   0",
107
                          "  0 a14 a13 a12    a11 a10  a9  a8",
108
                          " a7  a6  a5  a4     a3  a2  a1  a0",
109
                          "  o   o   o   o      o   o   o   o";
110
111
        loadpage_lo     = "  0   1   0   0      0   0   0   0",
112
                          "  0   0   x   x      x   x   x   x",
113
                          "  x   x  a5  a4     a3  a2  a1  a0",
114
                          "  i   i   i   i      i   i   i   i";
115
116
        loadpage_hi     = "  0   1   0   0      1   0   0   0",
117
                          "  0   0   x   x      x   x   x   x",
118
                          "  x   x  a5  a4     a3  a2  a1  a0",
119
                          "  i   i   i   i      i   i   i   i";
120
121
        writepage       = "  0   1   0   0      1   1   0   0",
122
                          "  0 a14 a13 a12    a11 a10  a9  a8",
123
                          " a7  a6   x   x      x   x   x   x",
124
                          "  x   x   x   x      x   x   x   x";
125
126
  mode    = 0x21;
127
  delay    = 6;
128
  blocksize  = 256;
129
  readsize  = 256;
130
      ;
131
132
    memory "lock"
133
        size            = 1;
134
        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
135
                          "x x x x  x x x x   x x o o  o o o o";
136
137
        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
138
                          "x x x x  x x x x   1 1 i i  i i i i";
139
        min_write_delay = 9000;
140
        max_write_delay = 9000;
141
      ;
142
143
    memory "lfuse"
144
        size            = 1;
145
        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
146
                          "x x x x  x x x x   o o o o  o o o o";
147
148
        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
149
                          "x x x x  x x x x   i i i i  i i i i";
150
        min_write_delay = 9000;
151
        max_write_delay = 9000;
152
      ;
153
154
    memory "hfuse"
155
        size            = 1;
156
        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
157
                          "x x x x  x x x x   o o o o  o o o o";
158
159
        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
160
                          "x x x x  x x x x   i i i i  i i i i";
161
        min_write_delay = 9000;
162
        max_write_delay = 9000;
163
      ;
164
165
    memory "efuse"
166
        size            = 1;
167
168
        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
169
                          "x x x x  x x x x  o o o o  o o o o";
170
171
        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
172
                          "x x x x  x x x x  1 1 1 1  1 i i i";
173
        min_write_delay = 9000;
174
        max_write_delay = 9000;
175
      ;
176
177
    memory "signature"
178
        size            = 3;
179
        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
180
                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
181
      ;
182
183
    memory "calibration"
184
        size            = 1;
185
186
        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
187
                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
188
        ;
189
  ;

von Markus W. (Firma: guloshop.de) (m-w)


Lesenswert?

Hallo Claudio,

danke, jetzt sieht man schon mehr. :-)

avrdude.conf schaut meiner Meinung nach korrekt aus.

Verdächtig scheint mir das hier:
1
avrdude: warning: cannot set sck period. please check for usbasp firmware update.

Meistens hat avrdude Recht, also kümmer dich am besten um ein 
Firmware-Update für deinen Programmer. (Ich nehme mal an, du verwendest 
einen USBasp von fischl.de oder einen dazu kompatiblen. Falls nicht, 
dann wäre die die Einstellung für den Programmer nicht korrekt.)

Hintergrund: Bei den USBasp mit Firmwarestand von vor Mai 2011 
funktioniert die avrdude-Option "-B" nicht. Diese Option ist aber oft 
notwendig, um die Schreib- oder Lesegeschwindigkeit zu drosseln, damit 
der Mikrocontroller mitkommt.

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.