We are working on cloned design of Arduino Mega 2560 Rev 3 Board for voltage monitoring application. We are able to flash the “Arduino-usbserial-mega.hex” on ATMega16U2 and able to detect as USB- Serial Adaptor. Also Burn Bootloader got successfully on Mega2560 using another Arduino Mega board as ISP.
When we try to upload a sketch through the port linked to ATMega16U2, observed errors and upload got failed. Since this port is not working, we had to upload the sketch through ICSP Header using another Arduino Mega board as ISP and upload is completed without any errors. The communication between ATMEGA16U2 & Host Laptop and ATMega2560 & Laptop through FT232RNQ seems to be fine. Looks like communication between ATMega16U2 & ATMega2560 is having issue. Is there any option to enable USB in arduino2560 to upload sketches through it. Please suggest.
Welcome
Please provide the schematic.
It would be useful if you could provide the complete error message. Please enable verbose output during upload and disable verbose output during compilation, perform an upload and post the output here using code tags (see How to get the best out of this forum).
How did you come to that conclusion? Loopback test (Loop-Back Test Instructions)?
Hook up a scope and check what is happening.
I'm not sure if I understand; the 2560 processor does not have USB functionality. If your FT232 provides a DTR output, you can use the FT232 instead of the 16U2; connect it to the Tx/Rx and reset pin of the 2560. Note that you need to have the current limiting resistors between the Tx/Rx of the 16U2 and the Rx/Tx of the 2560 in place (RN4A and RN4B in the reference design).
Hi! Log is as Below.
Sketch uses 5194 bytes (2%) of program storage space. Maximum is 253952 bytes.
Global variables use 441 bytes (5%) of dynamic memory, leaving 7751 bytes for local variables. Maximum is 8192 bytes.
"C:\Users\leelaprasad.r\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\leelaprasad.r\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega2560 -cwiring "-PCOM9" -b115200 -D "-Uflash:w:C:\Users\leelaprasad.r\AppData\Local\Temp\arduino\sketches\4B110A3E1500358EAD3D713E1330BD6D/VMON_Optimized_Code.ino.hex:i"
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\leelaprasad.r\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"
Using Port : COM9
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.
Failed uploading: uploading error: exit status 1
Schematics is same as Arduino Mega 2560 Rev3 Schematics.
ATMega16U2 USB Port is detecting on Host laptop as a COM Port.
we are able to get the data from 2560 Serial port (RXD1 & TXD1) when we upload our sketch through ICSP header.
Are there any fuse settings to be done to enable USB Sketch upload
AS requested, copy the compile error messages to the clipboard and post as it is displayed in code tags.
As it stands, no one knows where the error messages begin/end and your comments on whta you think is wrong, begin/end.
Sketch uses 5194 bytes (2%) of program storage space. Maximum is 253952 bytes.
Global variables use 441 bytes (5%) of dynamic memory, leaving 7751 bytes for local variables. Maximum is 8192 bytes.
"C:\Users\leelaprasad.r\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\leelaprasad.r\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega2560 -cwiring "-PCOM9" -b115200 -D "-Uflash:w:C:\Users\leelaprasad.r\AppData\Local\Temp\arduino\sketches\4B110A3E1500358EAD3D713E1330BD6D/VMON_Optimized_Code.ino.hex:i"
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\leelaprasad.r\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"
Using Port : COM9
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.
Failed uploading: uploading error: exit status 1
Run the loopback test. If you burned the correct bootloader it should show as an "Arduino Mega" in windows device manager.
Why did you pick that one? You might want to try another one, specifically one that has 16U2 in the name.
You did not mention that; that was probably through the FTDI adapter that you were talking about.
The fuses are taken care of when you burn the bootloader.
And now please learn to use code tags.
We will try loop back test once. And we have tried both "Arduino-usbserial-mega.hex " and "Arduino-usbserial-atmega16u2-Mega2560-Rev3.hex" but both are not working. Please share us the Hex file so that we can try that. Also It is not detecting as "Arduino Mega" in device manager. It is detecting as USB Serial Device.
Also could you please let us the know difference between "Arduino-usbserial-atmega16u2-Mega2560-Rev3.hex" and "Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex"
as both are different in size.
This is getting outside the area of my knowledge, sorry. I can't answer those questions. You'll have to wait for somebody else to come along.
Hi!
Please let us know what are the default hex files for Mega2560 & Mega16u2 and theirs versions that are factory programmed in Evaluation kits (Arduino Mega 2560 Rev3).
Thanks,
Leela Prasad R
Could you explain your problem a just more clear?
Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.zip (7.5 KB)
bootloader
stk500boot_v2_mega2560.zip (7.5 KB)
If you meant " usb to serial firmware, it can be found in firmwares/atmegaxxu2/arduino-usbserial
. Check Flash USB-to-serial firmware in DFU mode
@rleelaprasad, I've merged your two similar topics. As you can see, @b707 was already missing information that was available.