geekhack

geekhack Projects => Making Stuff Together! => Topic started by: Kageni on Tue, 09 March 2021, 21:17:21

Title: Custom pcb no work :(
Post by: Kageni on Tue, 09 March 2021, 21:17:21
Hey  guys I built a pcb with an atmega32u4-MUR hooked up to a USBC daughter card connected by a 4 pin connector. When I got them in the mail, and hooked them up, it isnt recognized by my computer or by QMK toolbox. USB device viewer shows nothing connected, or it shows "open pipe" "failed device enumeration". No DFU detected on QMK toolbox. The MCU is showing 5V on VCC, and I havent found any shorts. I did notice that one of the two 5.1k resistors on the usbC CC ports shows a resistance of 1.1k when its plugged in, but 5.1k when it isnt plugged in; While the other shows 5.1k on both.

https://github.com/Kageni-wq/Keeber
Title: Re: Custom pcb no work :(
Post by: nevin on Tue, 09 March 2021, 21:28:00
i may be wrong, but as far as i know... chips form manufacturers (used in pcb manufacturing) do not have any programming on them, including the bootloader.

as far as the resistor, not sure what the tolerances are for usb. you could swap it out or replace both and have a word with the manufacturer.
Title: Re: Custom pcb no work :(
Post by: Leslieann on Tue, 09 March 2021, 22:10:16
As Nevin said, it has no bootloader.
If you have an Arduino or Pi around you can jerry-rig that into a tool to load a bootloader and from there you can then load QMK.
Title: Re: Custom pcb no work :(
Post by: hanya on Tue, 09 March 2021, 23:16:07
ATmega32U4-AU(TQFP44 package) has pre-programmed bootloader. But ATmega32U4-MU(QFN44 package) does not.
See ordering information of the datasheet.
Title: Re: Custom pcb no work :(
Post by: nevin on Tue, 09 March 2021, 23:18:02
serial programmer right?
Title: Re: Custom pcb no work :(
Post by: Kageni on Tue, 09 March 2021, 23:36:29
I think I found the problem, the crystal footprint was wrong for some reason. So it has the two connections for the capacitors next to eachother on pads 1 and 2, while the crystal itself has these pads on opposite pads.
Title: Re: Custom pcb no work :(
Post by: nevin on Tue, 09 March 2021, 23:38:38
you'll still probably have the issue with the controller (no bootloader)
Title: Re: Custom pcb no work :(
Post by: Kageni on Tue, 09 March 2021, 23:41:51
Is there any 16MhZ crystals that have the pad order like that, so I can try resolder them and not have 5 useless pcbs :(
Title: Re: Custom pcb no work :(
Post by: suicidal_orange on Wed, 10 March 2021, 03:25:13
There must be or someone wouldn't have made the footprint - does the name in the software help?

If not you could cut the trace(s) and solder jumper wire(s) to the capacitors, not pretty but still close enough it should work.
Title: Re: Custom pcb no work :(
Post by: Rico on Wed, 10 March 2021, 03:48:37
Unfortunately not to my knowledge.
You can find variants with pins 2-4 as GND or 1-3 as GND (important to check also in order not to have a useless PCB), seen none as 1-2 or 3-4 as GND.

As for the QFN version not having a DFU bootloader, I tought it had one and designed a PCB without ISP header.
Still not tested it yet, I'll give you my result once I'll be able to do the check.
Title: Re: Custom pcb no work :(
Post by: Applet on Wed, 10 March 2021, 03:55:44
My guess is that there is a mismatch between the symbol used and the footprint used, so the designators will be wrong and it will be incompatible with the intended component/part. I do not know of any crystal with that footprint and pinout. You can probably find a 2-pin crystal that can fit on the two top pads.

I'd cut traces and solder jumper-wires. You should be able to get it working. Proper prototypes should have a few jumper-wires anyway :D

Both the common LQFP and QFN 32U4 ships with DFU-bootloader, the one without booloader is called ATmega32U4RC
Title: Re: Custom pcb no work :(
Post by: Rico on Wed, 10 March 2021, 04:50:22
The cut traces + jumper wire should do the trick.

Also FYA just took the time to check my own designed PCB that uses the same QFN chip.
And ... it is properly recognized in the device manager and in QMK toolbox :)
As said earlier, and just confirmed by me, QFN variant also has a DFU bootloader pre-flashed.
Pfff, so relieved not to redo my design again :D

So probably in your case the only thing to fix is the wiring of the crystal ;)
Title: Re: Custom pcb no work :(
Post by: nevin on Wed, 10 March 2021, 06:01:02
Good to know. Thanks
Title: Re: Custom pcb no work :(
Post by: Kageni on Wed, 10 March 2021, 12:16:01
Thanks for the info, who doesnt love a little extra soldered wires on their pcb anyways  :thumb:
Title: Re: Custom pcb no work :(
Post by: nevin on Wed, 10 March 2021, 12:30:21
it really ain't worth it unless it's not perfect. gotta have some personal touch/character.
Title: Re: Custom pcb no work :(
Post by: Kageni on Wed, 10 March 2021, 20:35:49
Well I cut the connections and spliced wires to get the correct wiring for the crystal and still nothing :(. Interestingly, Windows played the device connected sound when I shorted the USB date line and Vbus on the 4pin connector when I was testing for voltage. Any other ideas?
Title: Re: Custom pcb no work :(
Post by: Applet on Thu, 11 March 2021, 02:26:56
Does it still show up as "failed device enumeration"? I'd start by double checking that the pinout on your 4pin cable is correct (mostly that d+ and d- is not swapped)
Title: Re: Custom pcb no work :(
Post by: Kageni on Thu, 11 March 2021, 13:07:26
It doesn't show up at all, I downloaded the windows developor tools and using the usb device viewer usbview.exe, it shows nothing connected. I feel that when it briefly said device enumeration fail it was because I had shorted jumped one of the usb data lines to vbus when checking for voltage.

I am using https://lcsc.com/product-detail/Diodes-ESD_RUILON-Shenzhen-Ruilongyuan-Elec-RLST236A054LV_C20892.html for ESD protection on the USB daughter card, and running D-/D+ through it. Looking at the data sheet https://lcsc.com/product-detail/Diodes-ESD_RUILON-Shenzhen-Ruilongyuan-Elec-RLST236A054LV_C20892.html, it seems that stand off voltage for this device is 5V but I am reading 5.3V on VBUS. Could that be the problem? Both D+ and D- are showing 0 volts.

The only other thing I found that is weird is that R2, one of the CC 5.1k resistors shows 39.75 MOhms of resistance across it when plugged in, but 5.1k when unplugged. R1, the other CC 5.1k resistor is showing 5.1k whether usb is plugged in or not.
Title: Re: Custom pcb no work :(
Post by: Applet on Thu, 11 March 2021, 14:24:30
if you flip the usb connector/cable, I believe the other CC-resistor will show a changed resistance. I do think this is perfectly fine and part of the orientation detection. I'd recommend not to measure stuff like that when the device is powered.

Can you post a schematic of how the ESD-protection is connected on the daughter board? The chip should sit in parallel, the usb-signal should not go through it, could that be the issue?
Title: Re: Custom pcb no work :(
Post by: Kageni on Thu, 11 March 2021, 14:51:40
I attached both schematics. That makes sense for detecting orientation. Should there be voltage on the USb data lines?

The crystal is getting 0.834V so I feel like the MCU is functioning, just not communicating
Title: Re: Custom pcb no work :(
Post by: Kageni on Thu, 11 March 2021, 15:01:46
While I was measuring voltage on the crystal it played the usb connected noise and displayed this message. I couldn't replicate it however after unplugging and trying again, even after measuring voltage on crystal again.
Title: Re: Custom pcb no work :(
Post by: yui on Fri, 12 March 2021, 01:29:02
if playing around the crystal made it try to communicate, are you sure you do not have a bad solder join on one pin/capacitors? without a precise clock i do not think the controller can keep the usb timings, and so would fail to communicate, if one of the leg of the crystal was floating i do not think it would work properly and i dunno how the atmega32u react to that.
that would be my current guess as to what could be going wrong there. but then i am only a beginner when it comes to circuit design and only ever used PIC and pro micros.
Title: Re: Custom pcb no work :(
Post by: Applet on Fri, 12 March 2021, 02:37:39
Voltage levels is not a good indicator of working crystal, not sure about voltage levels on USB, but d+ or d- should be 3.3v iirc, to indicate which speed is used, but it's a differential signal between d+ and d-, so measuring voltage level is not a good indicator here either imo. I'd measure continuity/resistance between cable on daughter board (or connector) to 22 ohm resistors or legs on the MCU

Implementation of ESD-protection on daughter board should work.

yuis advice to check the crystal is good, could you share a pic of how you cut traces and added jumper-wires?
Title: Re: Custom pcb no work :(
Post by: Kageni on Fri, 12 March 2021, 17:47:07
I cut using a scalpel until their wasnt continuity. I tried it again on another pcb to see if it was bad connections were the culprit. I then tried cutting the connections to both crystal pads and reconnected them using wires of the same length to see if that would help, to no avail.
Title: Re: Custom pcb no work :(
Post by: suicidal_orange on Fri, 12 March 2021, 18:07:08
The two pads on the crystal are connected together but are they connected to ground?
Title: Re: Custom pcb no work :(
Post by: Kageni on Fri, 12 March 2021, 19:03:52
Not directly, they are connected to ground through the two capacitors only
Title: Re: Custom pcb no work :(
Post by: Applet on Sat, 13 March 2021, 03:47:09
It looks like you have mirrored how the crystal pinout is.

https://www5.epsondevice.com/en/products/crystal_unit/img/tsx3225_dimension.gif

[attach=1]

You can also skip attaching GND on the crystal, it is not needed, just make sure the crystal caps are grounded.

Suggestion:
[attach=2]
Title: Re: Custom pcb no work :(
Post by: Kageni on Sat, 13 March 2021, 11:47:55
Nice catch!! Thanks so much for all your help guys
Title: Re: Custom pcb no work :(
Post by: Rico on Sun, 14 March 2021, 13:31:01
Yay!

This is ugly as **** but it does the job :D

Well done!