Atmega16u2 firmware not working

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:

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

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.

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.

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.

You can upload any simple code like the Blink sketch to check pin HW on 16U2.

Budvar10:
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 :confused: