Bootloading and programming ATmega328 AU

Hello all,

Edit
########################
.....bit more reading.......
I use the Arduino Duemilanove w/ ATmega328 ...IT WORKS :grin: :grin:
#######################

I have a ATmega328au on a small breakout board and am having difficulty in getting things "whiring".

AT328 AU 5v @16mhz

ISP programmer is a USBTinyISP
USB - 232 converter is this one http://www.ebay.co.uk/itm/1x-USB-2-0-RS232-Converter-UART-TTL-Serial-CP2102-Arduino-UNO-ATMEGA-PIC-/320923619625?_trksid=p5197.m1992&_trkparms=aid%3D111000%26algo%3DREC.CURRENT%26ao%3D1%26asc%3D14%26meid%3D723313685952112829%26pid%3D100015%26prg%3D1006%26rk%3D1%26

The schematic is as per the usb 232 converter link, but I'm using the SMD 32 pin chip, not the DIP.

I made a new entry in the avrdude.conf file with the new sig:-
part
id = "m328au";
desc = "ATMEGA328au";
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;

Also I made a copy of the Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega328

pro5v328.name=Laser board 5V, (16 MHz) w/ ATmega328AU

pro.upload.protocol=arduino
pro5v328.upload.maximum_size=30720
pro5v328.upload.speed=57600

pro5v328.bootloader.low_fuses=0xFF
pro5v328.bootloader.high_fuses=0xDA
pro5v328.bootloader.extended_fuses=0x05
pro5v328.bootloader.path=atmega
pro5v328.bootloader.file=ATmegaBOOT_168_atmega328.hex
pro5v328.bootloader.unlock_bits=0x3F
pro5v328.bootloader.lock_bits=0x0F

pro5v328.build.mcu=atmega328au
pro5v328.build.f_cpu=16000000L
pro5v328.build.core=arduino
pro5v328.build.variant=standard

The preferences I added:- upload.verbose=true
to see what the status is after bootloading.

My problem is that the bootloading says complete although I get no status with verbose=true
LED attached to pin 17 sck just fashes slowly (I disconnect this during bootloading).

The USB 232 converter works OK with a loopback test.
When trying to upload a sketch (blink example) from the IDE (Uno board selected), the LED flashing quickly for about 1second then a short delay and I get the dreaded avrdude: stk500_getsync(): not in sync: resp=0x00 and the LED flashed slowly again.
Selecting the Laser board to upload a sketch, I get this error:-
Blink:-1: error: MCU 'atmega328au' supported for assembler only.

I've set the com port in the device manager to 57600 8 N 1 N
The usb has the DTR auto reset connected via a 0.2uf cap - I've also tried manual reset button too. (pressing the button stops the LED flashing)

So, I'm not sure if I have the correct bootloader uploaded or if it has been sucessfully loader or not or if I've used the correct board as a template for my AU version.
OR, if I have a problem just loading the sketch on the rs232 side of things.

I've given it my best shot, read and searched the forum on similar problems, but would appreciate some expert help as I'm stuck :slight_smile:

ATB
Derek

Glad you got it working, but why are you bothering to use a bootloader? You can use your ICSP to program the chip with your sketch directly.

dc42:
Glad you got it working, but why are you bothering to use a bootloader? You can use your ICSP to program the chip with your sketch directly.

Hi DC42,

Good question :-)..... I'm making a newby mistake.
I'm converting my prototype Arduino Uno project to a specific PCB, my assumption was to set up the same way (steep learing curve !)

It's a small project to fit in a confined space and currently has both the ICSP and serial programming ports.
It would be a big advantage to only have the ICSP commector (saving board space).

So I guess further reading is required and some testing on how to upload a sketch directly via ICSP.

Thanks for the heads up.

ATB
TQPF

Uploading via ICSP is really easy. You just select File->Upload using programmer from the menu in Arduino 1.0 or later. Two things you need to note:

  1. The ICSP normally powers the chip it is programming, so do not apply external power as well.

  2. In your design you need to avoid having the MISO, MOSI and SCLK pins driving heavy loads, or being driven from other chips without a series resistor, because the programmer needs to drive them. Also, whatever is attached to them had better not mind the signals that appear on them during programming.

dc42:
Uploading via ICSP is really easy......

Hi DC42
......not for me it aint :grin:
I've been at it of about 3hrs and it's a no go.
I can get it to upload the bootloader but not a sketch via the ICSP.

The error I get is :
unknown MCU 'atmega328au' specified
Blink:-1: error: MCU 'atmega328au' supported for assembler only

Which is strange as the atmega328au is specified in avrdude.conf
and sig set as :- signature = 0x1e 0x95 0x14;

bit stuck now.... =(

You should not need to edit avrdude.conf. You do need to edit boards.txt to add an entry for the atmega328au, and then select that "board" before using "upload using programmer". See Prototyping small embedded projects with Arduino | David Crocker's Solutions blog for more, but ignore the bit about editing the preferences file (you don't need to since "upload using programmer" was added).

I restarted from scrach.
reloaded boards.txt preferences.tx and avrdude.config incase I've mangled the files while trying to get things working,
Following the set up instructions in the link,
....still a no go.

my board.txt is below, I get this error:-

avrdude: Device signature = 0x1e9514
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
         Double check chip, or use -F to override this check.
miniau.name=Laser Board

miniau.upload.protocol=arduino
miniau.upload.maximum_size=28672
miniau.upload.speed=115200

miniau.bootloader.low_fuses=0xff
miniau.bootloader.high_fuses=0xd8
miniau.bootloader.extended_fuses=0x05
miniau.bootloader.path=optiboot
miniau.bootloader.file=optiboot_atmega328-Mini.hex
miniau.bootloader.unlock_bits=0x3F
miniau.bootloader.lock_bits=0x0F

miniau.build.mcu=atmega328p
miniau.build.f_cpu=16000000L
miniau.build.core=arduino
miniau.build.variant=standard

Changing miniau.build.mcu=atmega328p to miniau.build.mcu=atmega328au to match the additional device I've edited in avrdude.confing, error returned is:-
Blink:-1: error: MCU 'atmega328au' supported for assembler only

It looks like a configuration is missing. I can load the bootloader, so I know the ICSP is working.

Stucker than a stuck thing in glue

Looks like I was wrong and (using Arduino 1.01) you do need to edit avrdude.conf, because it doesn't contain a definition for the 328au. I would copy the atmega328p section, setting the name to atmega328au, the id to 328au, and adjusting the signature.

[EDIT: it sounds like you have done that already. Can you tell whether the "assembler only" message is coming from avrdude or from the Arduino IDE?]

On further investigation, a Google search suggests that the "supported for assembler only" message is coming from gcc.

You could try leaving the board set to 328p, but in the avrdude.conf section for the 328p, temporarily edit the device signature to match your 328au.

Why are you messing with new board types? Download/program like you had a 16 Mhz/5V Promini, or 3.3V/8MHz Promini.
The chip type is either m328, or m328P. The -AU and -PU (and -MU) only refer to the package type.

dc42:
On further investigation, a Google search suggests that the "supported for assembler only" message is coming from gcc.

You could try leaving the board set to 328p, but in the avrdude.conf section for the 328p, temporarily edit the device signature to match your 328au.

YES !!!
YES !!!
YES !!!

DC, as you suggested, leaving the name in the board as 328p and just changing the sig in avrdude to 14 (leaving the name as 328p) worked ....superb.

Thanks for all your help DC 8)

ATVB

CrossRoads:
Why are you messing with new board types? Download/program like you had a 16 Mhz/5V Promini, or 3.3V/8MHz Promini.
The chip type is either m328, or m328P. The -AU and -PU (and -MU) only refer to the package type.

Hi,

If the au / pu designation only refers to the package, why is the HEX signiature different (0F vs 14) ?....the IDE was balking at the sig.

You're right, I dont need to write a new board, but I do need to change the sig HEX value of the mega328p in the avrdude to get it working.

ATB

That signature refers to Atmega328 vs Atmega328P.
Both are available in -PU, -AU, -MU packages.

CrossRoads:
That signature refers to Atmega328 vs Atmega328P.
Both are available in -PU, -AU, -MU packages.

Ahhhh, the fog clears, I guess that is the problem that the information is spread when using google.
I thought I tried the uploading using the promini 5v 16mhz selected..... maybe not, in what felt like a million other things, but I'll try that again later.

ATB