What it does#
The CH340X from WCH shows up on the computer as a serial (COM) port and sends what the computer writes out of its TXD pin, and what arrives on RXD back to the computer, at 50 bit/s to 2 Mbit/s. Its clock is inside (no crystal), and its USB pull-up too. Boards with an ESP32-WROOM-32E use a chip like this to load firmware over the module’s UART0.
Pins (MSOP-10): 1 UD+, 2 UD−, 3 GND, 4 RTS#, 5 CTS#, 6 TNOW/DTR#, 7 VCC, 8 TXD, 9 RXD, 10 V3.
What it needs (WCH datasheet)#
- At 3.3 V: connect V3 to VCC and feed both from 3V3 (3.1–3.6 V). At 5 V, VCC takes 5 V and V3 gets its own 100 nF instead.
- 100 nF from VCC to GND, close to the pin.
- UD+ and UD− go straight to the USB D+ and D− lines: no series resistors.
- Cross the data lines: CH340X TXD goes to the MCU’s RXD, the MCU’s TXD to CH340X RXD.
Two USB devices on one port: TS3USB30E#
The TS3USB30E (TI, VSSOP-10) connects the D+/D− pair of one USB port to one of two chips, for example the microcontroller’s own USB or a USB-serial converter. S picks the port (low = D1, high = D2) and OE high switches both off. It runs from 3 to 4.3 V, so feed it 3V3, not VBUS; the switch adds at most 10 Ω. Its JLCPCB rotation is not checked yet.
Pitfalls#
- Two supplies: if the MCU has its own supply and the CH340X runs from USB, current can leak through the IO pins of the unpowered side. The CH340X blocks current into itself when it is off; powering both from the same 3V3 avoids the problem entirely.
- 5 V-tolerant IO only on the CH340X (and some CH340C/N batches) at 3.3 V; the CH340E in the same package is not.
- Pin 6 is TNOW (high while sending, for RS-485) by default; a 4.7 kΩ resistor from pin 6 to GND turns it into an open-drain DTR#.
Sources: WCH CH340DS1 datasheet V3D (power, USB pins, application circuits) and its MSOP-10 pinout.
Footprint#
MSOP-10, 3 × 3 mm, 0.5 mm pitch. No LCSC number yet: JLCPCB’s placement for this footprint has not been checked. Hand soldering is possible with a fine tip and flux.