[Solved] Need help debugging my first PCB project - Page 1
Forum section: electronics / beginners

author: Cory Parsnipson
author_rank: Contributor
timestamp: July 22, 2022, 12:12:46 am
content: Hello! I'm Cory, nice to meet you.I'm trying to learn how to design my own PCBs and I'm running into an issue with my first project. I sent out a USB hub design to be manufactured by JLCPCB, but when I assembled it and tried it out, I'm seeing that it is not working properly. I've come here hoping to get some tips or advice on how I should proceed to figure out what is malfunctioning...Here's the assembled circuit:And when I plug it into my computer, I'm getting an error message about the device exceeding port current limits.Also, note that I used a female USB port connector for the upstream data port, which required me to get a USB-A male to male cable to hook it up to a host device. I know this type of cable is generally "dangerous" to use, but because I had a brain fart and designed the upstream port with the wrong gender, I think using this cable shouldn't be contributing to the problem? Just including this tidbit of information in case my assumptions are wrong.I don't really know where to go from here... Doing some searches online shows me an article aboutESD management and robustnessbut I have no idea if this applies to my situation. The problem looks to be a short between power and ground, but it also looks like there is a lot that goes into shielding and surge protection when it comes to USB devices. If this is the case, I'm not so sure where to begin.DetailsI'm using the FE1.1s SSOP usb controller IC.DatasheetI quite literally copied the USB hub design from "Retrocution".link. I've examined the connections and topology of both circuits and as far as I can tell are the same. But I wouldn't be surprised if there was some other aspect of the design that I did not copy correctly. I'm very much a beginner when it comes to electronics and hands on stuff... Maybe this could be some very basic mistake I made that most people would take for granted?I used my multimeter to test continuity of my connections. Everything seems to check out, at least for all the junctions that I thought to check.The files and KiCAD (5) project I created is here:https://github.com/CoryParsnipson/usb-hub-pcb-test. I can dig into it and provide more details if needed, just let me know.EDIT:It might help if I included the schematic and front/back copper layers. The fill on the back isthe ground planeVCC and the fill on the front is the ground plane.EDIT 2:Here's a gerber image of Retrocution's USB design:Rats nest of my own design, in case this makes it easier to distinguish connections:Thanks so much for your attention!

author: ataradov
author_rank: Super Contributor
timestamp: July 22, 2022, 12:39:48 am
content: First of all, check for shorts on the VBUS/GND.It is hard to tell, since the datasheet is very brief, but it looks like generally people connect OVCJ to 3.3 V if not used.Disregard that, it is connected.

author: Cory Parsnipson
author_rank: Contributor
timestamp: July 22, 2022, 12:51:10 am
content: Just tried VBUSM and BUSJ with ground and looks like there isn't a short.I do have another newbie question though...If I put my multimeter contacts on either side of the 0603 ceramic capacitors, sometimes it causes the multimeter to "chirp", like maybe there's a small bridge somewhere. Is this something I should worry about?

author: ataradov
author_rank: Super Contributor
timestamp: July 22, 2022, 12:58:57 am
content: Try the actual pins on the upstream USB connector.The chirp is normal. To test continuity multimeter applies some voltage. A discharged capacitor appears as a short to that voltage. Then capacitor charges and the short goes away.Technically if you have a lot of capacitance on VBUS, it might cause the host to detect the surge. But assuming that C3 is <= 10 uF, you should be fine. Your schematic lacks any values, so it is hard to tell.

author: Cory Parsnipson
author_rank: Contributor
timestamp: July 22, 2022, 01:50:58 am
content: Quote from: ataradov on July 22, 2022, 12:58:57 amAhh okay, that's good to know. Thanks! The capacitors are 10uF 0603 ceramic capacitors.Quote from: ataradov on July 22, 2022, 12:58:57 amI went over things touching one probe to the actual pin on the IC and the other probe to something on the PCB. All connections are as depicted in the schematic. Checking for shorts between the ground and VCC planes hasn't exposed anything yet...

author: ataradov
author_rank: Super Contributor
timestamp: July 22, 2022, 02:26:42 am
content: So, there is no short between pin 1 and 4 on the J3?I have no idea what that message from windows actually means. It might be that it reads the maximum power from the descriptor and does not think the port can supply that much.Are you plugging it into a root port or through a hub?Try to remove C3 entirely just to see what happens.

author: ataradov
author_rank: Super Contributor
timestamp: July 22, 2022, 02:31:58 am
content: Wait, don't you have GND and VCC switched on the connector?

author: Cory Parsnipson
author_rank: Contributor
timestamp: July 22, 2022, 03:26:12 am
content: Quote from: ataradov on July 22, 2022, 02:26:42 amI don't think so. I checked J3 and the other two connectors as well. Probing the GND and 5V pins of each shows no contact.I plugged it into both built in ports on my laptop.I removed C3 like you suggested and it still gives me the power surge error message.Quote from: ataradov on July 22, 2022, 02:31:58 amUhhh, I thought it might have but I double checked this earlier today. Are you referring to this diagram?The J3 footprint (rightmost connector) has the power pin (bottommost) connected to VDD5 by the fat trace that goes between the GND and D+ pins on the front (maybe this was a bad routing choice?). This pin has contacts going into the power plane (back-side). The ground pin (the topmost one) is connected to the ground plane on the front. Does this work out ok?================I ordered some more capacitors and USB ports. I ordered Retrocution's design too, so I think I'm going to try and assemble one of those and see if it works.

author: ataradov
author_rank: Super Contributor
timestamp: July 22, 2022, 04:19:33 am
content: Here is the pinout of the connector. If you match it with yours, you will see that +5V should be on the crystal side.But also, is the rats nest version different from the routed one? I'm really confused.No, rats nest just has connector rotated.

author: pcprogrammer
author_rank: Super Contributor
timestamp: July 22, 2022, 04:43:32 am
content: Another observation of your PCB raises the question why you routed a trace on the top layer from the incoming USB connector VCC to the IC where you could have easily use a via to the bottom layer being VCC near the capacitor close to the IC.Something unrelated to your PCB is about the images you added. You are using a "cloud" service and not the forums own storage to hold them. When this external source disappears your posts become somewhat useless. See this topic for more info:https://www.eevblog.com/forum/beginners/test-can-somebody-let-me-know-if-this-image-shows-up/msg4286842/#msg4286842

author: inse
author_rank: Super Contributor
timestamp: July 22, 2022, 04:55:00 am
content: I confirm ataradov, either the pin # orientation differs between the CAD model and the socket or could this also have happened from incorrectly mirroring components from top to bottom side?

author: Cory Parsnipson
author_rank: Contributor
timestamp: July 22, 2022, 05:47:32 am
content: Quote from: ataradov on July 22, 2022, 04:19:33 amOh wow, good catch. I should have checked the USB spec...My symbol is wrong! This was made a couple months ago so I don't remember if I made it myself or if I downloaded it from a random website. But pin 1 is marked as GND and pin 4 is VCC so I hooked it up wrong.This explains why the layout didn't complain. Oh dear...Gonna see if there's a way to salvage this.Thank you so much,ataradov!Quote from: inse on July 22, 2022, 04:55:00 amProbably user error or that I just downloaded an incompatible symbol. This one says CU01125, which I am not familiar with. The connector I'm using is CU01SAV1S00. But regardless, the USB pinout should be standard? I think I must have modified the symbol. I'll have to remember to be more careful.Quote from: pcprogrammer on July 22, 2022, 04:43:32 amWell, like I said, this is the first time I'm doing this. That's a good idea. I'll make sure to do that if I end up doing a second run.Quote from: pcprogrammer on July 22, 2022, 04:43:32 amOk, I changed the images.

author: pcprogrammer
author_rank: Super Contributor
timestamp: July 22, 2022, 09:52:38 am
content: A simple check to verify the pin out is to just measure it. When you have a spare connector just hook it up to a cable and use your multi-meter to determine the polarity.Fixing the circuit board is a bit trickier, because just rotating the connectors would screw up the DP and DM connections and the shielding will be off. But you could cut the traces and use some wires to make the correct connections.And then hope that the chip survived

author: inse
author_rank: Super Contributor
timestamp: July 22, 2022, 12:26:09 pm
content: Mount the connectors from the other side :-)

author: pcprogrammer
author_rank: Super Contributor
timestamp: July 22, 2022, 12:35:12 pm
content: Quote from: inse on July 22, 2022, 12:26:09 pmStill leaves the swap of the USB signals.

author: Cory Parsnipson
author_rank: Contributor
timestamp: July 31, 2022, 10:30:16 pm
content: I made some progress, but I am now running into a different error. Props again toinsefor suggesting to mount the connectors on the other side.I was going to add wires to the connector, when I noticed that the D+ and D- signals are also mirrored between the actual connector part and my symbol. So this opens up the possibility of mounting the connectors to the backside of the PCB as previously suggested.I did that and plugged it in and it was successfully recognized as a Generic USB Hub! Woo hoo!...or not...I'm not sure what happened, but between it working with the connectors on, and me adding solder to the mounting pins and adding a case, it somehow stopped working!I'm getting an error saying the device description request failed.So close...

author: ataradov
author_rank: Super Contributor
timestamp: August 01, 2022, 01:48:20 am
content: Windows messages are not very helpful. Do you have access to any Linux machine? PC or RPi would do. Look at the output of the 'dmesg' command and it usually generates more helpful messages.

author: Cory Parsnipson
author_rank: Contributor
timestamp: August 01, 2022, 02:33:43 am
content: Sure! I have a Fedora partition.Code:[ 189.720453] usb 2-1: new high-speed USB device number 16 using xhci_hcd[ 189.834332] usb 2-1: device descriptor read/64, error -71[ 190.056443] usb 2-1: device descriptor read/64, error -71[ 191.178478] usb 2-1: new full-speed USB device number 18 using xhci_hcd[ 191.293340] usb 2-1: device descriptor read/64, error -71[ 191.512383] usb 2-1: device descriptor read/64, error -71[ 191.728366] usb 2-1: new full-speed USB device number 19 using xhci_hcd[ 191.842355] usb 2-1: device descriptor read/64, error -71[ 192.064383] usb 2-1: device descriptor read/64, error -71[ 192.166421] usb usb2-port1: attempt power cycle[ 192.546344] usb 2-1: new full-speed USB device number 20 using xhci_hcd[ 192.546537] usb 2-1: Device not responding to setup address.[ 192.750477] usb 2-1: Device not responding to setup address.[ 192.958364] usb 2-1: device not accepting address 20, error -71[ 193.072321] usb 2-1: new full-speed USB device number 21 using xhci_hcd[ 193.072513] usb 2-1: Device not responding to setup address.[ 193.278504] usb 2-1: Device not responding to setup address.[ 193.486351] usb 2-1: device not accepting address 21, error -71[ 193.486464] usb usb2-port1: unable to enumerate USB deviceDropping the dmesg output here. I'm gonna go google what these error codes mean.

author: ataradov
author_rank: Super Contributor
timestamp: August 01, 2022, 03:32:59 am
content: This basically means that there is no communication of any sort, but the device is attached to the bus (pull-up resistor enabled).Something is wrong either with the data pins or the IC itself. The only thing you can check externally is that crystal is oscillating and the frequency is correct.Is this the same IC that was subject to the reversed voltage? This may be the source of the issue.

author: Cory Parsnipson
author_rank: Contributor
timestamp: August 01, 2022, 03:38:37 am
content: Ok. I think I might have damaged the connector when I was putting the case on. I guess... I could try again and not be so rough on the connector this time.

author: tooki
author_rank: Super Contributor
timestamp: August 01, 2022, 09:43:10 am
content: Quote from: Cory Parsnipson on August 01, 2022, 03:38:37 amwhat makes you suspect the connector? USB A connectors are fairly robust. I agree with atadarov’s suspicions.Another possibility of how the IC could become damaged is ESD. As a hot-plug interface, USB data and power lines should be ESD protected. One way is with a discrete TVS diode to ground on each of those 3 lines. Another (what I used on my most recent project with USB) is a “steering” diode array ESD protection device like the Bourns CD143A-SR05LC and countless pin-compatible equivalents available from numerous vendors. Pin 1 goes to ground, pin 4 goes to the USB 5V, and pins 2 and 3 each go to one of the data lines.For sure I’d put one on the upstream (PC-facing) port, but it probably wouldn’t hurt to have them on the downstream ports, too.

author: Cory Parsnipson
author_rank: Contributor
timestamp: August 01, 2022, 07:26:28 pm
content: Oh, I should have mentioned before that I assembled a second PCB because I was unable to de-solder the USB connectors on the first one. So the IC on the second one should be okay.A problem with the data pins sounds reasonable. I was thinking along those lines when I meant that the connectors might be damaged. When I put on the case, I initially made the holes too small, so I was trying to see if I could flex the cover a little and push the connectors through. I didn't use too much force, but you never know.I reflowed the USB connector pins with a soldering iron and checked for bridges, but the result hasn't changed.Quote from: tooki on August 01, 2022, 09:43:10 amIs this likely to have happened by me touching it with my hands? Or does this happen when plugging into the host computer? If it has been damaged by ESD, is it fixable/diagnosable or would I have to assemble a whole new board?

author: ataradov
author_rank: Super Contributor
timestamp: August 01, 2022, 07:53:10 pm
content: ESD damage is possible, but not very likely. A lot of it depends on your environment and handling of the device as well. There is no easy way to test if it is ESD damage, the easiest approach is to just swap the IC or build one more board.Check the clock, it would at least tell you that oscillator has started.

author: Cory Parsnipson
author_rank: Contributor
timestamp: August 02, 2022, 07:49:29 pm
content: I went to go touch grass yesterday and then this morning when I went to go probe the crystal with an oscilloscope, I plugged it into my docking station and it mysteriously started working...Here's what I tried:* Plugging into right side USB port of docking station* plugging into left side USB port of docking station (this has a battery symbol above it)* plugging directly into both USB ports of laptop* unplugging, waiting ten minutes, and then plugging back into a USB port* put it back into the case, screw everything on, and plug directly into laptop and docking stationNo problems reported anymore...I guess I'll mark this solved, though I still feel kind of in the dark about what went wrong in that last part. Thanks for your help, everyone!==============As an exercise, I went to look for a waveform anyway, though I'm not sure how useful it is given that the thing is working as expected now...I broke out an oscilloscope and attached the probe and ground to both sides of the 12MHz crystal. This gives me a very clear sinusoid, though it appears to be oscillating at 80MHz-ish based on the numbers on the screen? Is that normal?? I suppose I could be reading it incorrectly or using the oscilloscope improperly.

author: ataradov
author_rank: Super Contributor
timestamp: August 02, 2022, 09:01:35 pm
content: Don't attach the scope across the crystal. Attach the ground to to the ground and probe either of the pins. Ideally XOUT, as it has lower chance to cause disruptions.Usually with crustal oscillators when things start to work if you touch them means that you don't have correct load capacitors. Usually you need to have load capacitors to the ground from both XIN and XOUT. Some value may be already integrated into the IC, but the actual value you need depends on the crystal parameters. The datasheet here does not have any information, so all you can do is guess.If it keeps being unreliable, add 5-15 pF capacitors to the ground from the crystal pins. In your case it would be a bit tricky, since you have 5V pour on the soldering side. This is another case why you want to have mostly ground pours.

author: Cory Parsnipson
author_rank: Contributor
timestamp: August 03, 2022, 04:20:00 am
content: Quote from: ataradov on August 02, 2022, 09:01:35 pmAh ok, oops...Here's the probe on XOUT with the ground on the J1 connector ground. Looks like it's got a period close to 80ns, though there seems to be some interference happening.Quote from: ataradov on August 02, 2022, 09:01:35 pmAre there guidelines for ground/power pours? I just read some very brief tips about using KiCAD about wanting one ground and one 5V on either side of the PCB.

author: ataradov
author_rank: Super Contributor
timestamp: August 03, 2022, 04:33:57 am
content: The clock looks strange. Capture it with DC coupling. The amplitude is really high, this has to overdrive the crystal, but it is possible that it is by design.On 2 layer boards use ground pour on both layers and everything else with traces or local polygons. For 4 layer boards, two internal layers are typically power and ground while outside are for the signals. And if signal density on the outside layers is not too high, add ground pour there too.

author: Cory Parsnipson
author_rank: Contributor
timestamp: August 03, 2022, 05:52:28 am
content: Ok, what about this one?

author: ataradov
author_rank: Super Contributor
timestamp: August 03, 2022, 06:06:56 am
content: This is very strange. DC coupling yet there is no DC component. They must use some very strange oscillator design. But I guess if it looks clean and works, then I would not mess with it.

author: Cory Parsnipson
author_rank: Contributor
timestamp: August 03, 2022, 06:14:00 am
content: Maybe I'll be able to come back to this after I get a few more projects under my belt and understand the design more deeply. That's the hope anyway.Thanks again for your help!

author: pcprogrammer
author_rank: Super Contributor
timestamp: August 03, 2022, 07:22:47 am
content: Quote from: ataradov on August 03, 2022, 06:06:56 amThe shown menu is for the trigger settings. I don't know how this scope works, but could it be that the channel it self is still in AC coupling?

author: Cory Parsnipson
author_rank: Contributor
timestamp: August 03, 2022, 08:43:12 am
content: Quote from: pcprogrammer on August 03, 2022, 07:22:47 amOh, good catch. I dipped into the TDS 210 manual and it says that I need to press the "menu" button under the channel. When I did that, it was on DC coupling the entire time.I switched it to AC coupling, but... it's somehow still the same? I tried this a couple of times. However, as you can probably tell, I'm not too familiar with the oscilloscope either.EDIT:Actually I had an idea. So far I've been using probes that were two alligator clips. I pulled out the "needle-y" one and used that one instead. What I found was that I got a weird DC signal if I connected the probe to the XOUT and ground to ground. But if I reversed it--connecting ground to XOUT and the probe to ground, I get this waveform:And here's the same one with AC coupling:Probe pic:

author: pcprogrammer
author_rank: Super Contributor
timestamp: August 03, 2022, 10:57:21 am
content: With the actual probe, did you check if it is set to 1x or 10x, or is a fixed 10x probe?On your scope it is set to 1x, and if the probe is 10x the voltage readings are of.Also if the probe is 10x, the input attenuation of the scope needs to be changed to get a proper reading. With the scope ground connected to the USB device ground, while the device is connected to the computer can cause problems when the scope ground is not isolated and the computer is grounded too.These are things you should be aware of when doing measurements. Connecting a probe ground to something that is not ground could damage both your scope and your device under test.

author: Cory Parsnipson
author_rank: Contributor
timestamp: August 03, 2022, 11:03:12 am
content: The probe is set to 1x.Quote from: pcprogrammer on August 03, 2022, 10:57:21 amOh damn I didn't know that..

author: Zero999
author_rank: Super Contributor
timestamp: August 03, 2022, 11:06:39 am
content: Quote from: ataradov on August 02, 2022, 09:01:35 pmNote, it should work with the capacitors connected to 5V. As far as AC is concerned, the ground and supply rails are interchangeable.

author: ataradov
author_rank: Super Contributor
timestamp: August 03, 2022, 02:04:00 pm
content: Quote from: Cory Parsnipson on August 03, 2022, 11:03:12 amIt needs to be set to 10x. Forget that 1x mode exists for general measurements.

author: tooki
author_rank: Super Contributor
timestamp: August 03, 2022, 05:52:36 pm
content: Quote from: Cory Parsnipson on August 03, 2022, 11:03:12 amYep, oscilloscope ground really is ground, not a floating negative like on a multimeter. Dave has a video named something to the effect of “how to not blow up your oscilloscope” which I highly recommend watching.