Pages: [1]   Go Down
Author Topic: how to flash atmega16u2 for a arduinoDUE based project  (Read 1062 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 1
Posts: 160
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello everyone,
i'm working on project based on Arduino DUE. i've already printed my pcb and now i need to flash the atmega16u2.
according to this guide http://arduino.cc/en/Hacking/Upgrading16U2Due i shouldd be able to flash it siply connecting to the usb and then execute avrdude.exe from the cmd program(i'm using windows seven), but in my arduino due IDE (1.5.2) i can't find avrdude.conf nor the hex file.
where can i find them?
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8473
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i shouldd be able to flash it siply connecting to the usb and then execute avrdude.exe
I don't know that is correct, it implies that the u2 has a ROM-based bootloader and I don't think it does. I always thought you had to use ISP to program it.

I admit the article seems to say you can.

I found the avrdude files with a quick search under Vista, I would think 7 has a search facility?

<install-folder>\hardware\tools\avr\etc

for the conf file, I too cannot find that exact HEX file though but there are a lot of them in the bootloaders folder.

_____
Rob
« Last Edit: August 24, 2013, 05:49:54 pm by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Earth
Offline Offline
Sr. Member
****
Karma: 14
Posts: 326
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello everyone,
i'm working on project based on Arduino DUE. i've already printed my pcb and now i need to flash the atmega16u2.
according to this guide http://arduino.cc/en/Hacking/Upgrading16U2Due i shouldd be able to flash it siply connecting to the usb and then execute avrdude.exe from the cmd program(i'm using windows seven), but in my arduino due IDE (1.5.2) i can't find avrdude.conf nor the hex file.
where can i find them?

No, according to that article you need to flash a special sketch to an Uno or Mega and use it as an ISP (or use a normal ISP tool) to connect to a six pin connector on the Due that lets you flash the 16U2 chip. You can't just program that chip through the USB port.
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 160
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok, so i have to use arduino, but how do i check if the isp-sketch is really working? how do i know when the process is over?
Logged

Earth
Offline Offline
Sr. Member
****
Karma: 14
Posts: 326
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The arduino is just a conduit. You still have to use avrdude (the program) and it will give you status messages. So, if it tells you that things didn't work then something is wrong. Otherewise, it'll tell you that it did work.
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 160
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thus the problem remain where do i find the files? can you check if you have them in your IDE folder?

EDIT: i think i've found the files. the 16u2.hex file i have to upload is the one located in the folder arduino-1.5.2\hardware\arduino\sam\firmwares\atmega16u2\ Arduino-DUE-usbserial.hex, right?
« Last Edit: August 26, 2013, 05:38:50 am by aureliusss » Logged

Earth
Offline Offline
Sr. Member
****
Karma: 14
Posts: 326
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That sounds right to me. You should try it and report back so that other people know what to do and where to find the files in the future.
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 160
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok Then i've found avrdude.conf in arduino-1.5.2\hardware\tools\avr\etc while the hex file is located in arduino-1.5.2\hardware\arduino\sam\firmwares\atmega16u2

(for windows users) the line to write in the cmd is your_path\avrdude.exe -C avrdude.conf -c arduino -P COMyour_com_port -b 19200 -p  m16u2 -vvv -U flash:w: your_path_to_hex_file:i

but a problem still remains: my arduinoDUE based board is not recognised from my laptop(windows 7) so i can't upload any sketch. it is seen as unknown device with error code 43. i've tried several ways to udpate drivers, but none of them worked.
Logged

Pages: [1]   Go Up
Jump to: