Pages: [1] 2   Go Down
Author Topic: Burining Bootloader via AVRISP-MKII onto ATMEGA328-AU  (Read 11863 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 96
Why is it so?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

having issues with using an AVRISP-MKII to burn a bootloader for an ATMEGA328-AU (the same as on the Pro and Pro Mini)

Error:
Code:
avrdude: Expected signature for ATMEGA328P is 1E 95 0F


I have a schema here



any thoughts?
Logged

Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

'avrdude' checks the signature bytes in the target processor against what it expects, given the processor that you told it about.  So, if the actual processor is a 328-AU and it's expecting a 328P, the signature won't match.  Can you select a different processor from the menu?
Logged

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 96
Why is it so?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

i take it i can add a new board to the boards.txt file.
like so

Code:
[new board name].build.mcu=atmega328p

where can i change the mcu listing type. i can't find how to add the AU
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks like the atmega328 (without the P) isn't in the config file for avrdude. Locate file avrdude.conf, open it in an editor and locate the atmega328p section, which starts like this:

#------------------------------------------------------------
# ATmega328
#------------------------------------------------------------

part
    id              = "m328p";
    desc            = "ATMEGA328P";
     has_debugwire = yes;
     flash_instr   = 0xB6, 0x01, 0x11;
     eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
                0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
                0x99, 0xF9, 0xBB, 0xAF;
    stk500_devcode  = 0x86;
    # avr910_devcode = 0x;
    signature       = 0x1e 0x95 0x0F;


If you change the final signature byte from 0x0F to 0x14 then it should recognise your chip (but not a atmega328p). Or you could try copying the whole atmega328p definition and in the copy change the id, desc and signature byte fields, then use the new id or desc to identify the chip in boards.txt, but I don't know whether this works.
« Last Edit: August 09, 2011, 04:04:38 pm by dc42 » Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 96
Why is it so?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay, so turns out i actually have an ATMEGA328-AU-ND not an ATMEGA328P-AU-ND   

any suggestions?
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 167
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

everything after the first dash is irrelevant, dc42 still has exactly the answer you need.
Logged

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 96
Why is it so?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

silly question but where do i find the avrdude.conf on PC
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I installed the arduino software into C:\arduino-0022. My conf file is C:\arduino-0022\hardware\tools\avr\etc\avrdude.conf.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 96
Why is it so?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Creating a new entry worked beautifully

Code:
#------------------------------------------------------------
# ATmega328-AU-ND
#------------------------------------------------------------

part
    id              = "m328au";
    desc            = "ATMEGA328-AU-ND";
     has_debugwire = yes;
     flash_instr   = 0xB6, 0x01, 0x11;
     eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
             0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
             0x99, 0xF9, 0xBB, 0xAF;
    stk500_devcode  = 0x86;
    # avr910_devcode = 0x;
    signature       = 0x1e 0x95 0x14;


and then in boards.txt

Code:
.build.mcu=m328au

thanks again for all your helps
Logged

0
Offline Offline
Sr. Member
****
Karma: 2
Posts: 262
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hm, I am attempting to program an ATMEGA-328-PU-ND using an Arduino Duemilanove w/ ArduinoISP loaded onto it. I just added the entries as stated by 32teeth to my avrdude.conf and board.txt file, but I got the following error message when I tried to upload my sketch:

Code:
unknown MCU 'm328au' specified
Known MCU names:
   avr2
   at90s2313
   at90s2323
   at90s2333
   at90s2343
   attiny22
   attiny26
   at90s4414
   at90s4433
   at90s4434
   at90s8515
   at90c8534
   at90s8535
   avr25
   attiny13
   attiny13a
   attiny2313
   attiny24
   attiny44
   attiny84
   attiny25
   attiny45
   attiny85
   attiny261
   attiny461
   attiny861
   attiny43u
   attiny87
   attiny48
   attiny88
   at86rf401
   avr3
   at43usb320
   at43usb355
   at76c711
   avr31
   atmega103
   avr35
   at90usb82
   at90usb162
   attiny167
   attiny327
   avr4
   atmega8
   atmega48
   atmega48p
   atmega88
   atmega88p
   atmega8515
   atmega8535
   atmega8hva
   at90pwm1
   at90pwm2
   at90pwm2b
   at90pwm3
   at90pwm3b
   at90pwm81
   avr5
   atmega16
   atmega161
   atmega162
   atmega163
   atmega164p
   atmega165
   atmega165p
   atmega168
   atmega168p
   atmega169
   atmega169p
   atmega32
   atmega323
   atmega324p
   atmega325
   atmega325p
   atmega3250
   atmega3250p
   atmega328p
   atmega329
   atmega329p
   atmega3290
   atmega3290p
   atmega32hvb
   atmega406
   atmega64
   atmega640
   atmega644
   atmega644p
   atmega645
   atmega6450
   atmega649
   atmega6490
   atmega16hva
   at90can32
   at90can64
   at90pwm216
   at90pwm316
   atmega32c1
   atmega64c1
   atmega16m1
   atmega32m1
   atmega64m1
   atmega16u4
   atmega32u4
   atmega32u6
   at90scr100
   at90usb646
   at90usb647
   at94k
   avr51
   atmega128
   atmega1280
   atmega1281
   atmega1284p
   atmega128rfa1
   at90can128
   at90usb1286
   at90usb1287
   m3000f
   m3000s
   m3001b
   avr6
   atmega2560
   atmega2561
   avrxmega3
   atxmega32a4
   avrxmega4
   atxmega64a3
   avrxmega5
   atxmega64a1
   avrxmega6
   atxmega128a3
   atxmega256a3
   atxmega256a3b
   avrxmega7
   atxmega128a1
   avr1
   at90s1200
   attiny11
   attiny12
   attiny15
   attiny28
/home/jason/arduino-0021/hardware/arduino/cores/arduino/WInterrupts.c:1: error: MCU ‘m328au’ supported for assembler only
/home/jason/arduino-0021/hardware/arduino/cores/arduino/WInterrupts.c: In function ‘attachInterrupt’:
/home/jason/arduino-0021/hardware/arduino/cores/arduino/WInterrupts.c:90: error: ‘EICRA’ undeclared (first use in this function)
/home/jason/arduino-0021/hardware/arduino/cores/arduino/WInterrupts.c:90: error: (Each undeclared identifier is reported only once
/home/jason/arduino-0021/hardware/arduino/cores/arduino/WInterrupts.c:90: error: for each function it appears in.)
/home/jason/arduino-0021/hardware/arduino/cores/arduino/WInterrupts.c:90: error: ‘ISC00’ undeclared (first use in this function)
/home/jason/arduino-0021/hardware/arduino/cores/arduino/WInterrupts.c:90: error: ‘ISC01’ undeclared (first use in this function)
/home/jason/arduino-0021/hardware/arduino/cores/arduino/WInterrupts.c:91: error: ‘EIMSK’ undeclared (first use in this function)
/home/jason/arduino-0021/hardware/arduino/cores/arduino/WInterrupts.c:91: error: ‘INT0’ undeclared (first use in this function)
/home/jason/arduino-0021/hardware/arduino/cores/arduino/WInterrupts.c:94: error: ‘ISC10’ undeclared (first use in this function)
/home/jason/arduino-0021/hardware/arduino/cores/arduino/WInterrupts.c:94: error: ‘ISC11’ undeclared (first use in this function)
/home/jason/arduino-0021/hardware/arduino/cores/arduino/WInterrupts.c:95: error: ‘INT1’ undeclared (first use in this function)
/home/jason/arduino-0021/hardware/arduino/cores/arduino/WInterrupts.c: In function ‘detachInterrupt’:
/home/jason/arduino-0021/hardware/arduino/cores/arduino/WInterrupts.c:135: error: ‘EIMSK’ undeclared (first use in this function)
/home/jason/arduino-0021/hardware/arduino/cores/arduino/WInterrupts.c:135: error: ‘INT0’ undeclared (first use in this function)
/home/jason/arduino-0021/hardware/arduino/cores/arduino/WInterrupts.c:138: error: ‘INT1’ undeclared (first use in this function)

I am using Arduino 0021 on a 32-bit Ubuntu 10.04 installation.
Logged

Grad student, creative technologist, OSHW engineer
http://jason-webb.info

Offline Offline
Full Member
***
Karma: 0
Posts: 167
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you sure that avrdude is looking at the correct conf file?  it doesn't look like your edit is in the config that it's reading at all.

The only other nitpick is that 328 is the proper device name, 328AU does not exist.  But that is entirely a cosmetic change and has no relation to your problem.
Logged

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 96
Why is it so?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That error looks very odd as if you are missing a part of the .conf file.
Did you add an entire duplicate entry or only the portion i posted?
Logged

0
Offline Offline
Sr. Member
****
Karma: 2
Posts: 262
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I only added the bit you posted, so maybe thats the problem. I will try duplicating an entire entry and replacing the relevent section with what you posted.
Logged

Grad student, creative technologist, OSHW engineer
http://jason-webb.info

0
Offline Offline
Sr. Member
****
Karma: 2
Posts: 262
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I duplicated the entry for ATMEGA328P, then replaced the relevant lines that you posted in avrdude.conf. Then, in boards.txt, I changed the following line:

Code:
atmega328.build.mcu=atmega328p

to

Code:
atmega328.build.mcu=m328au

and now when I try to upload, I get an error saying that the stk500 programmer is not responding.

I'm curious, where do you get the .build.mcu identifier from? At first I thought it was the "id" field of the chip you want from avrdude.conf, but when I search that file for atmega328p (the original identifier), it does not match any 'id' field, only a 'desc' field.
Logged

Grad student, creative technologist, OSHW engineer
http://jason-webb.info

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

When to says the stk500 programmer is not responding, it means your Arduino that you have configured as an ISP. Did you load the ArduinoISP sketch on it, before changing the upload.using line? Did you add the capacitor to disable the auto reset on the Uno?
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Pages: [1] 2   Go Up
Jump to: