Probleme beim Sketch-Upload mit externem CH340G

Hallo zusammen,

ich habe einen ATMEGA328P-PU auf einem Steckbrett aufgebaut und mit folgendem Bootloader geladen:

##############################################################
atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)

atmega328bb.upload.tool=avrdude

atmega328bb.upload.protocol=arduino
atmega328bb.upload.maximum_size=32256
atmega328bb.upload.maximum_data_size=2048
atmega328bb.upload.speed=57600

atmega328bb.bootloader.tool=arduino:avrdude

atmega328bb.bootloader.low_fuses=0xE2
atmega328bb.bootloader.high_fuses=0xDA
atmega328bb.bootloader.extended_fuses=0x05

atmega328bb.bootloader.path=atmega
atmega328bb.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex
atmega328bb.bootloader.unlock_bits=0x3F
atmega328bb.bootloader.lock_bits=0x0F

atmega328bb.build.mcu=atmega328p
atmega328bb.build.f_cpu=8000000L
atmega328bb.build.core=arduino:arduino
atmega328bb.build.variant=arduino:standard

atmega328bb.build.board=AVR_UNO

Die Flags sind so gesetzt, dass der interne Oszillator mit 8 MHz verwendet wird.
Nun verwende ich einen USB-Serial-Adapter mit dem CH340G Chip um den Sketch hochzuladen.

All dies Funktioniert einwandfrei.

Nun tausche ich den ATMEGA328P-PU durch den ATMEGA328P-AU (SMD Version) aus und passe natürlich die neue Pinbelegung an. Der gleiche Bootloader wird wierder (mit einem Arduino-Board) aufgespielt.

Allerdings habe ich nun Probleme beim Upload eines Sketches mit dem CH340G. Es wird immer nur folgendes ausgegeben:

Der Sketch verwendet 12.952 Bytes (42%) des Programmspeicherplatzes. Das Maximum sind 30.720 Bytes.
Globale Variablen verwenden 661 Bytes des dynamischen Speichers.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x8d
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x8d
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x8d
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x8d
avrdude: stk500_recv(): programmer is not responding
Probleme beim Hochladen auf die Platine. Hilfestellung dazu unter http://www.arduino.cc/en/Guide/Troubleshooting#upload .
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x8d
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x8d
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x8d
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x8d
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x8d
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x8d

Laut Datenblatt und Internetrecherche sind die beiden ATMEGA von der Funktion und dem inneren Aufbau identisch (nur die Pinbelegung ist natürlich anders).
Wenn ich den Sketch mit dem Programmer(Arduino-Board) aufspiele klappt alles reibungslos, also ist der Chip io und die Flags wurden korrekt gesetzt.

Was mache ich falsch?

Rx goes to Tx, Tx goes to Rx. You have Rx to Rx, Tx to Tx.

Thanks to DrAzzy

but the conections are ok, if I change RX and TX I get this Error:

avrdude: stk500_set_extended_parms(): protocol error, expect=0x14, resp=0x94
avrdude: stk500_initialize(): failed

Could be inaccuracy of the internal clock not being good enough for UART. The factory calibration isn't done to tight enough tolerances to ensure that it works with UART (some chips get a better calibration than others, so some, but not all, will work). That's why even the 8mhz arduino boards use a crystal...

If the scheme that you presented is accurate, then you need pullUp resistor from Vcc to RESET pin( 10 KOhm ).

And then you need to connect TX(atmega) to RX(ch340g) and RX(atmega) to TX(ch340g), on ch340g link you provided that is specified.

DrAzzy:
Could be inaccuracy of the internal clock not being good enough for UART. The factory calibration isn't done to tight enough tolerances to ensure that it works with UART

I think you are right. I order a 8 MHz Resonator and test again.
Also I update my scheme.

Your schematic now has a pull down resistor on reset, instead of a pull up resistor.

I recommend using the ATmega328P part in your schematic drawing program, instead of using Uno. It would make a better and easier to understand schematic and may be less confusion if you need to get more help. I found it somewhat difficult to use at first, but I do now recommend Eagle for drawing schematics, and the SparkFun website has a pretty good tutorial to get started and Sparkfun has a library of common parts you can add to Eagle to make it easier to use.

https://learn.sparkfun.com/tutorials/using-eagle-schematic

https://learn.sparkfun.com/tutorials/how-to-install-and-setup-eagle