Electronic – Arduino Mega 2560 Bootloader Question

arduinobootloader

I'm building a specific PCB around the Arduino Mega 2560 platform. Based on the official Mega 2560 schematic, there is two microcontroller; the 16U2 and 2560-15AU. Both of them have their own ICSP pin header.

I plan to load the bootloader with an another Arduino as ISP. Do I just need to do the process with the ICSP pin for the 2560-15AU only or do I also need to do it for the 16U2?

Best Answer

I think we need to clear up what both those chips to.

You can program the 2560 with the ICSP header - yes, but every time you want to program it you will need to use that 6 pin connector.

The 16u2 is loaded with a special firmware that allows you to connect it to a USB port and it will show up as a USB device. This is how your normal Arduino Mega works. The 16u2 is loaded with USB drivers and such, allowing it to be recognizable on your computer. Then when you click upload on the computer, the 16u2 will program the 2560 via RX/TX. There are plenty of articles that explain that process in depth.

The reason you need an ICSP header for the 16u2 is so you can load the USB bootloader onto it to allow it to interface with a computer.

The reason you need the ICSP header for the 2560 is so that you can load it with its own initial core bootloader, which will then allow it to be programmed via RX/TX from the 16u2 via USB.

If you only put the ICSP header on for your 2560, sure, you can use the 2560 like a normal Mega (MINUS the COM PORT readout!!), you'll just need another Arduino to program it every single time. At this point, your 16u2 will be worthless and not do anything unless you have alternative methods to load it with the USB bootloader.

If you are going to be putting the 16u2 on your PCB, might as well include a method to program it and add USB connectivity! Also you'll want the 16u2 working so that you can pull up com ports for debugging.

Best of luck