Go Down

Topic: Atmega16u2 firmware not working (Read 265 times) previous topic - next topic

Math_00

Sep 10, 2018, 12:57 pm Last Edit: Sep 10, 2018, 12:59 pm by Math_00
I'm designing a board which is basically an Arduino Mega, but with more pins. The schematic is basically the same as the official Arduino Mega schematic:

https://www.arduino.cc/en/uploads/Main/arduino-mega2560_R3-sch.pdf

I flashed the Atmega16u2 with the file MEGA-dfu_and_usbserial_combined.hex located in the arduino folder. It worked fine, and there wasn't a problem with flashing. Then i installed a driver, and in the device manager i see it as Arduino Mega 2560, which should be correct.

But when i try to upload a sketch to the Atmega2560, a timeout happens. I measured the RX and TX pin on the Atmega16u2, but they don't do anything, they're just constantly on +5V. Also the Oscillator is successfully oscillating at 16MHz.

I kind of doubt that the Atmega16u2 is broken, as i wouldn't be able to flash it then, would i?

Has anyone got any idea? I'm really lost

Budvar10

#1
Sep 10, 2018, 02:04 pm Last Edit: Sep 10, 2018, 02:05 pm by Budvar10
Port can be damaged even if you are able to upload to flash memory. However, it can be caused by any other error, include incorrectly working program. Anyway, you can test behaviour of Rx and Tx on ATmega16U2 via the loop-back test: connect tx with rx and via terminal you should receive your typing (Mega2560 must be disconnected or down). How did you measure Rx and Tx? Original board has Rx and Tx LEDs so it is very easy to observe an activity on serial port.

Maybe you could post your schematics.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

Math_00

Port can be damaged even if you are able to upload to flash memory. However, it can be caused by any other error, include incorrectly working program. Anyway, you can test behaviour of Rx and Tx on ATmega16U2 via the loop-back test: connect tx with rx and via terminal you should receive your typing (Mega2560 must be disconnected or down). How did you measure Rx and Tx? Original board has Rx and Tx LEDs so it is very easy to observe an activity on serial port.

Maybe you could post your schematics.
I'm using an oscilloscope to measure Rx and Tx. They're just at 5V nothing more. The schematics for my project are the same as the one i posted(at least the part with the 16u2). I disconnected the 2560 from the 16u2, but i still haven't got a signal.

Budvar10

You can upload any simple code like the Blink sketch to check pin HW on 16U2.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

Math_00

You can upload any simple code like the Blink sketch to check pin HW on 16U2.
Yeah, that's actually what i'm doing. I can measure the data from the USB Port going to the 16u2, but nothing comes out :/

Go Up