Error with Uploading Bootloader

I have a blank MCU (MEGA2560) and UCB Control (ATMEGA16U2-MUR).

ATTEMPT 1
In order to flash the bootloader into the MCU, I used Atmel Ice and followed this tutorial: http://wspublishing.net/avr-c/restoring-arduino-mega-bootloader/

In order to flash the USB control firmware, I followed this tutorial: Arduino - DFUProgramming8U2

When I tried to upload code onto my MCU using the USB port, I got a Timeout Error.

I checked that the USB had proper firmware by doing the loopback test (http://forum.arduino.cc/index.php?topic=73748.0) and it worked.

So I assume my bootloader is the issue.

ATTEMPT 2
I tried to flash the bootloader using this tutorial: http://soc.ninja/documentation/programming-atmega2560-with-arduino-uno-or-mega/.

Again, tried to upload code onto my MCU via USB, but Timeout Error.

The weird thing is, I have also tried uploading code via the third link and it was successful. If it can upload code directly onto the MCU, I’m not sure why it would not be able to upload the bootloader.

I’m not sure if it has to do with the fuses, lock bits, oscillator, etc.

Any thoughts? I’ve attached the hardware layout.

kprims:
https://forum.arduino.cc/index.php?topic=575054.0

I tried all the solutions in that thread, none worked. I thought it’d be easier if I created a clean, new one.

You need:

  1. correct HW: 30pF caps on oscillators is little bit more but maybe it works; I suppose it is OK as you was able to upload FW etc.
  2. correct FW in 16U2; make sure it works correctly - Rx, Tx and DTR must pass to the 2560 (Tx, Rx and RESET); BTW: R16 1k is for what ???, the best way how to check it is loopback test for Rx,Tx and RESET with some LED or DMM (if you are lack of advanced measuring devices).
  3. Mega need the bootloader; if you are using IDE, you need not care about fuses

Budvar10:

  1. correct HW: 30pF caps on oscillators is little bit more but maybe it works; I suppose it is OK as you was able to upload FW etc.

Yeah, that's what I believed as well.

Budvar10:
2. correct FW in 16U2; make sure it works correctly - Rx, Tx and DTR must pass to the 2560 (Tx, Rx and RESET); BTW: R16 1k is for what ???, the best way how to check it is loopback test for Rx,Tx and RESET with some LED or DMM (if you are lack of advanced measuring devices).

I did the loopback test provided here: http://forum.arduino.cc/index.php?topic=73748.0 and passed, should I do a different loop back test?
The DTR is an input to the USB chip, how would it pass to the 2560 exactly?
The /Reset from my JTAG pin is what passes the RESET to the /Reset input on the MCU AND through a 0.1uF capacitor to the DTR input on the USB control. Did I do the circuit wrong?
If you look at the schematic for the Arduino Mega (Arduino Mega 2560 Rev3 | Arduino Official Store), it shows there needs to be a 1k to ground at the DTR input.

Budvar10:
3. Mega need the bootloader; if you are using IDE, you need not care about fuses

I do care about fuses if I use the first link, right? Since it is done via Atmel ICE and Atmel Studio 7.
If I am using the IDE, should I change code for the Arduino ISP, such as baud rate and heartbeat pins, etc? Does that affect whether the bootloader is uploaded properly?

I did the loopback test provided here: http://forum.arduino.cc/index.php?topic=73748.0 and passed, should I do a different loop back test?

No, it is good if passed.

The DTR is from 8U2 to 2560. It is RESET signal for Mega2560.

If you look at the schematic for the Arduino Mega (Arduino Mega 2560 Rev3 | Arduino Official Store), it shows there needs to be a 1k to ground at the DTR input.

Ah yes, it's ok.

You can find fuses and lock in the boards.txt (it is part of Arduino SW).

Budvar10:
No, it is good if passed.

The DTR is from 8U2 to 2560. It is RESET signal for Mega2560.

I am using a 16U2. Ah, but even if it’s an output from the 16U, it doesn’t change my hardware.

Budvar10:
You can find fuses and lock in the boards.txt (it is part of Arduino SW).

Alright, I’ll try again using the fuse settings in boards.txt

I am using a 16U2.

It is similar to 8U2 with bigger flash. The newest Arduino uses 16U2.

Budvar10:
It is similar to 8U2 with bigger flash. The newest Arduino uses 16U2.

Does this change anything? Or was this just additional information for my reference.

Just for info.