Go Down

Topic: Problems with USB (Atmega16U2) on Arduino-based project (Read 1 time) previous topic - next topic

BruceX

Dec 16, 2013, 11:57 pm Last Edit: Dec 17, 2013, 12:05 am by BruceX Reason: 1
Hej,

I have a problem with a current project and after all my hair went grey about it, I ask you for heeelllp ...

The project is a midi controller box which is composed of two pcbs, appended you see the schematic and layout (bottom & top) of the affected board. Almost everything works fine, but one essential feature does not: Communication between the Atmega16U2 and the Atmega328 (Mega8-P in the schematic, but it is a 328).

- All the functions (reading analogue values & digital states, controlling leds, midi-communication) of the 328 work fine
- The Atmega16U2 can be flashed via USB without problems (via Atmels Flip and is now loaded with the current firmware "Arduino-usbserial-atmega16u2-Uno-Rev3.hex"). Also the 16u2 was recognized by my computer from the first moment without any problems and after flashing with the firmware it is also without problems recognized as "Arduino Uno" by Windows and its presence is shown by the Arduino IDE with the correct Com-port.

BUT I can not upload software via USB (per Arduino IDE) to the 328. Also the auto-reset function does not work - i can reset the 328 via an reset switch on the second pcb, nevertheless no update possible, always "avrdude: stk500_getsync(): not in sync: resp=0x02" (but "0x02" is not constant, sometimes it is "0x04" or "0x06").

Note:
- IC3 and the Optocouplers where left out while all tests
- At first I left out F1 and used only external power supply
- Afterwards I soldered in F1 (=powered via usb / and of course did not use external power at the same time) - no change
- I removed "R9" - no change
- J1 is a jumper to en/disable autoreset - wether set or not (if not then resetted manually) - no change
- I measured the resistors in the Rx and Tx lines (and "re-soldered" it), replaced the capacitor in the reset line, replaced the quartz and its capacitors and finally replaced the 16U2 (and C10 and C11) - no change
- I have an USB serial connector which I connected to Rx, Tx and via an 0,1uF cap to the reset pin of the 328 in place - upload works, but only with external reset (with the button on the 2nd pcb) and only if I take power from the USB serial connector*
- I put a simple Serial output program on the 328 which gives me a repeated "1" on the Arduino IDE serial monitor when connected with the Arduino Uno board which I have, but gives me strange signs when connected with my developed pcb


I am almost cryyyyin - any help out there?


*But with a genuine Arduino Uno I noticed the same behaviour.

brgds,
Marcel

Go Up