Problems programming a PCB based on Arduino Mega rev3 schematics

I've developed a project that basically consists of reproducing the Arduino Mega schematics and export it to an ECAD tool to test my PCB design skills after a technical course.

After recieving the PCB and soldering the components everything worked fine from an electrical point of wiev. The problem came up in the very last step when I tried to program the PCB from the Arduino IDE using the USB. The IDE tries to upload the sketch but this never happens, giving the following error:

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "D:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM7 Using Programmer : wiring Overriding Baud Rate : 115200

avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_getsync(): timeout communicating with programmer

avrdude done. Thank you.

An error ocurred while uploading the sketch

Until now I've tried (successfully) the following steps:

I've programmed ATMEGA2560-16AU using an Arduino USB-to-Serial module, which is basically the same circuit included in the Arduino Mega, and it works fine. Before programming, I bootloaded the micro following information offered in Arduino official web page.
https://store.arduino.cc/product/A000059

I've to point out that to program the PCB from outside I had to remove C7 cap (100nF) to cancel ATMEGA16U2 DTR line reset effects on ATMEGA2560-16AU. After programming, I resoldered it to allow ATMEGA16U2 to communicate with ATMEGA2560-16AU (ARDUINO MEGA Schematics attached).

I've followed a tutorial to flash ATMEGA16U2 using ATMEL's FLIP software. After put the microcontroller in DFU mode and install the proper Arduino driver, the computer and Arduino IDE both recognize it as a COM port, so everything looks to be fine.
So I think after a full revision the problem may be focused on some king of communication problem between the two microcontrolers, but I'm not sure...

I'll be very grateful if anyone can give me some feedback to fix this issue.

Thanks in advance

"So I think after a full revision the problem may be focused on some king of communication problem between the two microcontrolers, but I'm not sure..."

Post your schematic.

Please, find my schematics attached

I've just try a serial loopback test and it passed successfully, which I think means USB communication is OK (just between the PC and ATMEGA16U2...

Was the loopback placed between PE0 to PE1? The ATmega2560 needs a bootloader. It will then use the TX0 (PE1) and RX0 (PE0) lines to upload firmware when DTR toggles (normally that is an active low signal).

Edison2020:
I've developed a project that basically consists of reproducing the Arduino Mega schematics and export it to an ECAD tool to test my PCB design skills after a technical course.

ron_sutherland:
Was the loopback placed between PE0 to PE1? The ATmega2560 needs a bootloader. It will then use the TX0 (PE1) and RX0 (PE0) lines to upload firmware when DTR toggles (normally that is an active low signal).

Yep, I agree with @ron_sutherland, Both the 16U2 and the ATMEGA2560 needs to be initially programmed using ISP. Both of those chips are MCU's, they need a program to function. the 16U2 has to be programmed to receive USB and transfer it to the Serial of the Mega2560, The Mega2560 need the 'bootloader' that listens to Serial just after a reset.

Chuck.

Indeed both microcontrollers have a bootloader charged on 'em via ISP. They work fine separately, the problem I explained comes after try to program the Mega 2560 through the ATMEGA 16U2 using USB...