Go Down

Topic: Loading bootloader to an Atmega8U2, easiest way? (Read 2 times) previous topic - next topic

monkey123

I have a PCB I designed very similar to the Mega2560 Arduino.  It has an AtMega8U2 that is properly connected to USB and also to an AtMega2560.  The chips are straight from Atmel and stock.

What is the best way to get things going?  My understanding is I first have to get a bootloader onto the AtMega8U2 chip?  I can use USB or I have an AVR ISP MkII programmer available as well.  ISP pin headers are available for both chips.  What is the easiest way?

DirtBiker

I don't think the bootloader goes on the '8U2.  It needs the USB to serial communications code.  The code they put on the original UNO's 8U2 might work.  It should be available from the Arduino site some where.  The bootloader would go on the '2560.

Either way, you'd need your ISP programmer to put the code on them.
Dirt Biker

retrolefty

#2
Nov 24, 2012, 05:03 pm Last Edit: Nov 24, 2012, 05:05 pm by retrolefty Reason: 1

I don't think the bootloader goes on the '8U2.  It needs the USB to serial communications code.  The code they put on the original UNO's 8U2 might work.  It should be available from the Arduino site some where.  The bootloader would go on the '2560.

Either way, you'd need your ISP programmer to put the code on them.



That is correct. One is said to burn 'firmware' into a 8U2 chip to turn it into a USB serial converter chip. A bootloader is what one burns into the mega2560 chip. To burn the firmware into a 8U2 chip or a bootloader in amega2560 requires a hardware ICSP programmer which can be a standard arduino board running the arduino as ISP sketch or some other standalone hardware ICSP programmer of which the arduino IDE supports several different models that can be seen in the IDE tools/programmer pull down menu. Both the firmware and bootloader HEX files are included in the arduino IDE distribution software that is installed in your PC.

Lefty

monkey123

Thanks for the help!  So to clarify, I'd need to FIRST load the firmware onto the 8U2.  I would then have USB functionality, correct?  Can I then use the 8U2 over USB to load the bootloader AND software onto the 2560?

What file do I need for the 8U2 firmware and how would I load it with the hardware programmer?  I have the Atmel FLIP software if that helps.

retrolefty


Thanks for the help!  So to clarify, I'd need to FIRST load the firmware onto the 8U2.  I would then have USB functionality, correct?
Yes, you would then have created a USB virtual serial port communications link to and from the PC.

 Can I then use the 8U2 over USB to load the bootloader AND software onto the 2560?
No, the bootloader for the 2560 needs to be installed via a ICSP hardware programmer, which can be another arduino board loaded with the arduino as ICP sketch. The 8U2 chip is not a ICSP programmer, it's just a USB serial converter chip. So whatever you used to install the firmware into the 8U2 chip is what you would use to burn the bootloader into the 2560 chip.

What file do I need for the 8U2 firmware and how would I load it with the hardware programmer?  I have the Atmel FLIP software if that helps.

I've never owned a arduino board with a 8U2 chip so I'm not the one to give you specific steps to take. However the first step is identifying and obtaining the ICSP programmer you are going to use to load the firmware and later the bootloader for the 2560 chip.

Lefty


monkey123

I'll be using the AVR ISP MkII programmer.  So:

1. Load firmware on 8U2.
2. Load bootloader on 2560.
3. I can now connect via USB and upload sketches to the 2560?

BillO

Facts just don't care if you ignore them.

monkey123

Can anybody point me in the direction to load the 8U2 firmware and 2560 bootloader?  All the resources I've found have been less than helpful.

BillO

#8
Nov 24, 2012, 08:32 pm Last Edit: Nov 24, 2012, 08:48 pm by BillO Reason: 1
You could use avrdude.  Use a command line like:

avrdude -P com4 -b 19200 -p m328p -c avrisp -Ulock:w:0x0F:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m -Uefuse:w:0x05:m -V -Uflash:w:MyFile.hex:i -u

That particular command will load MyFile.hex onto an ATmega328p through an AVR ISP attached to com4.  You would have to make the desired/required changes to the com port (-P), to the chip (-p),  to the fuses and to specify whatever hex file you want.  Id' suggest reading through the avrdude documentation too.

EDIT:
Actually, if you have the Arduino software loaded up, go to the Ardunio home directory.  Then go to:

hardware->arduino->firmwares

In that directory is a README.txt that explains how to get the firmware onto the ATmega8U2 for use with a ATmega2560.
Facts just don't care if you ignore them.

monkey123

Crazy question.  When updating the firmware or bootloader on these chips, do you need to connect them to external power, or does the ICSP programmer supply power to the chips?

DirtBiker

Some programmers can supply power through the ICSP, some can't.  So the quick answer is, it depends on the programmer you choose.
Dirt Biker

monkey123


Some programmers can supply power through the ICSP, some can't.  So the quick answer is, it depends on the programmer you choose.


AVR ISP Mkii

retrolefty



Some programmers can supply power through the ICSP, some can't.  So the quick answer is, it depends on the programmer you choose.


AVR ISP Mkii


I believe that is one of the programmers that cannot power the target chip, thus external power is need for the target chip.

Lefty

DirtBiker

Quote
I believe that is one of the programmers that cannot power the target chip


I believe so as well.
Dirt Biker

monkey123




Some programmers can supply power through the ICSP, some can't.  So the quick answer is, it depends on the programmer you choose.


AVR ISP Mkii


I believe that is one of the programmers that cannot power the target chip, thus external power is need for the target chip.

Lefty


Interesting. But that would make sense since it is reading 0 volts. Thanks for the tip. :) I will try external power to the chip.

Go Up