I designed and fabricated a custom board that was inspired by the Arduino Mega 2560 R3 (atmega2560 MC and atmega 16u2 Usb to Serial Chip).
Currently I have proven out all features of the board except the serial communication between the Microcontroller and My computer.
Here is the situation:
- I can use Arduino to compile a hex file from my sketch file and output it to a temporary folder on my computer. I can then upload this file directly to the atmega 2560 using the ICSP Header Pins, an AVRISP MKii programmer, and atmel Studio. This has allowed me to vet out all of the various IO on the board.
- However, I cannot upload the sketch/program through the actual Arduino IDE. When I try to upload it directly through arduino and the USBto Serial Chip I receive the following error:
Using Port : \.\COM9
Using Programmer : stk500v2
Overriding Baud Rate : 115200
avrdude: Send: . [1b] .  .  .  . [0e] .  . 
avrdude: stk500v2_ReceiveMessage(): timeout
- I have done the loop-back test to verify that the, the USB cable, Chip Driver, Firmware and USB to serial Chip is working properly. Any command that I send through the Arduino serial monitors returns the same message.
- Additionally, I have actually uploaded a simple serial output program directly to the microcontroller (using the ICSP pins and atmel Studio). It reads an analog voltage value and outputs it to the TX/RX lines. This data is then passed through the UsbtoSerial Chip and onto my computer. However! When i try to view this data, it appears to be corrupted. I receive the data! but it is not readable. If the MC sends a single line, I receive a single Line. If the MC sends a series of data sets, I receive a series of Data sets.
- I have tested the baudrate as potential issue extensively but it doesn't seem to be the issue.
- I have tested the fuses and lock bits when programming the MC but that doesn't seem to be the issue either.
In summary, it seems the Atmega 2560 and the Atmega 16u2 are communicating with each other but they dont seem to be speaking the same "language" or at the same rate. There is some type of serial communication issue that I am missing here.
Does anyone have any thoughts?