[Answered] CH340C powered by USB issue - Page 1
Forum section: electronics / projects

author: josefmtd
author_rank: Contributor
timestamp: September 27, 2018, 10:50:54 am
content: Hi! I have designed a CH340-based Arduino compatible standalone board for my project, I designed two of them, one is powered by 5V directly from USB port, the other is powered by 3.3V from AP2112-3.3V regulator from USB port. The 3.3V powered CH340 works just fine, however the CH340 powered by 5V does not seem to work at all, I hooked it up to Raspberry Pi 3, my dual-boot Ubuntu 18.04, or Windows 10, none recognize the USB device.What I have tested:- Different ICs (tested 6 of them, none of them work when supplied by 5V, tried 3 CH340 on my 3v3 board, all work without a hitch)- Tested the voltages, CH340 receives 5V on VCC and the internal regulator does output 3.3V on the V3 pin- Checked the connection, USB differential pair, VCC, and GND, all seems to be connected without a problem- Added bypass capacitor (I forgot to add 5V-GND bypass capacitor in the design, ended up soldering a ceramic 100nF between pin 16 and 1)- CH340 driver, I have the correct driver, my 3v3 board is detected and works just fine on my Raspberry Pi, dual-boot Ubuntu 18.04 or Windows 10What I have not tested:- Supplying 3V3 externally to the V3 pinDoes anyone have experience with this chip and can share something I'm probably missing?Thanks in advance!

author: t1d
author_rank: Super Contributor
timestamp: September 27, 2018, 11:13:56 am
content: Well, we could use some additional information... You say you designed the boards... Did you make them, or did you use a board house? With either, you could have made a design mistake, with a connection, or there could by a manufacturing defect. You should do a point to point continuity test, on the board. Compare it to the other board.Do you have an oscilloscope?Is the CH340 5v compatible?Is the oscillator oscillating?Did you remember to tie the ground, between the CH340 and the board.Tell use more... Post you schematics and board layout, for whatever design program you use. Also post these in pdf format.

author: josefmtd
author_rank: Contributor
timestamp: September 27, 2018, 11:54:43 am
content: Quote from: t1d on September 27, 2018, 11:13:56 amThanks for your response, I designed the board with Altium, manufactured the board on JLCPCB, I did test the point to point continuity, all seems to work just expected.Quote from: t1d on September 27, 2018, 11:13:56 amI do have access to an oscilloscopeQuote from: t1d on September 27, 2018, 11:13:56 amThe datasheet suggests so, Arduino Nano I have with CH340G works happily supplied by 5V, I assume it should work fine for the CH340C (the built in crystal version)Quote from: t1d on September 27, 2018, 11:13:56 amI have yet to test that, I'll probably try checking tomorrow morning GMT+7Quote from: t1d on September 27, 2018, 11:13:56 amI like to think that I have done that countless of time to not forget tie all the ground togetherI forgot to attach the snippet of the schematic, here it is.Layout 3v3 shows the AP2112, ICSP 6, regulator capacitors, a molex full size USB PCB edge, and the CH340CLayout 5V shows the micro usb port, decoupling capacitors, a micro USB molex USB PCB edgeYou may notice I forgot to use the DTR to control the ATmega328p's reset, yep that's one of my dumb mistakes

author: Peabody
author_rank: Super Contributor
timestamp: September 27, 2018, 02:10:06 pm
content: There's a datasheet somewhere that says C1 should be 4.7-20nfd. I don't know if that really makes any difference, but it might be worth trying it.

author: mikerj
author_rank: Super Contributor
timestamp: September 27, 2018, 03:27:14 pm
content: Is the net name for the USB 5v pin changed from Vusb to Vcc in the 5v design?

author: ThomasDK
author_rank: Regular Contributor
timestamp: September 27, 2018, 03:40:23 pm
content: The 5V version has no decoupling on the VCC line... That's probably the problem.Edit: Didn't see you put 100n on it. That might be too little. Try a couple of uF.

author: bson
author_rank: Unknown
timestamp: September 27, 2018, 08:28:59 pm
content: Where's the pullup? Take a look at this:The wire heading up leads to a TPS7B6933 3.3V regulator that provides system power, but it could also be used as-is for a legacy 5V design.Oh, and please get in the habit of drawing complete sub circuits. Just using net names and a bunch of scattered parts I have no idea if you have a pullup somewhere else not shown.

author: oPossum
author_rank: Super Contributor
timestamp: September 27, 2018, 11:40:50 pm
content: The micro USB pinout is wrong. D+ and D- are swapped.

author: josefmtd
author_rank: Contributor
timestamp: September 28, 2018, 12:47:34 am
content: Quote from: oPossum on September 27, 2018, 11:40:50 pmO my Lord! I messed up real bad! No wonder it won't work! Thank you so much for pointing out my stupid mistake!This is my worst fuck up so farThanks for everyone for pointing out some of the flaws, I'm grateful for your valuable inputs!