Hi all, I am working on a project based around the Arduino Mega2560. I have just finished designing and assembling the first custom PCB.
The PCB uses an ATMega16U2 and ATMega2560 just like the proper Arduino Mega does. All supported components (clock crystals, capacitors, etc) are the same values used on the Arduino Mega.
However, I am having an absolute nightmare trying to configure the ATMega16U2! When I connect the USB cable I get nothing at all in device manager, as if it's dead.
However I have managed to use my Arduino UNO as an ISP to load the bootloader onto the ATMega2560, and it appears to work fine. The "L" LED binks, and when you hold the reset button it stops blinking until released.
I just cannot for the life of me get the USB functionality with the ATMega16U2! I am able to communicate via ICSP and AVRDude. AVRDude sees the IC fine, communicates fine and can adjust fuses, etc over ICSP with no issues, but I am obviously doing something wrong.
The commands I am sending are as follows.....
First send: avrdude -c arduino -P COM1 -b 19200 -p m16u2 -t -e, this should remove any lock bits
Next send: avrdude -c arduino -P COM1 -b 19200 -p m16u2 -F -U efuse:w:0xF4:m -U hfuse:w0xD9:m -U lfuse:w:0xEF:m -U lock:w:0xCF:m, this should set the fuses, values taken from this thread here... What next? Mega2560r3 ATmega16U2 DFU Win8 USB - Installation & Troubleshooting - Arduino Forum
Finally send: avrdude.exe -c arduino -P COM1 -b 19200 -p m16u2 -F -U flash:w:Arduino-usbserial-atmega16u2-Mega2560-Rev3:i, this will program the firmware with the one which comes with Arduino IDE.
All steps work fine, no errors at all, but when I connect the USB cable I get nothing at all, PC just does not recognise it.