Author Topic: Custom pcb no work :(  (Read 2683 times)

0 Members and 1 Guest are viewing this topic.

Offline Kageni

  • Thread Starter
  • Posts: 24
Custom pcb no work :(
« 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

Offline nevin

  • Posts: 1646
  • Location: US
Re: Custom pcb no work :(
« Reply #1 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.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline Leslieann

  • * Elevated Elder
  • Posts: 4519
Re: Custom pcb no work :(
« Reply #2 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.
Novelkeys NK65AE w/62g Zilents/39g springs
More
62g Zilents/lubed/Novelkeys 39g springs, HK Gaming Thick PBT caps, Netdot Gen10 magnetic cable, pic
| Filco MJ2 L.E. Vortex Case, Jailhouse Blues, heavily customized
More
Vortex case squared up/blasted finish removed/custom feet/paint/winkey blockoff plate, HID Liberator, stainless steel universal plate, 3d printed adapters, Type C, Netdot Gen10 magnetic cable, foam sound dampened, HK Gaming Thick PBT caps (o-ringed), Cherry Jailhouse Blues w/lubed/clipped Cherry light springs, 40g actuation
| GMMK TKL
More
w/ Kailh Purple Pros/lubed/Novelkeys 39g springs, HK Gaming Thick PBT caps, Netdot Gen10 Magnetic cable
| PF65 3d printed 65% w/LCD and hot swap
More
Box Jades, Interchangeable trim, mini lcd, QMK, underglow, HK Gaming Thick PBT caps, O-rings, Netdot Gen10 magnetic cable, in progress link
| Magicforce 68
More
MF68 pcb, Outemu Blues, in progress
| YMDK75 Jail Housed Gateron Blues
More
J-spacers, YMDK Thick PBT, O-rings, SIP sockets
| KBT Race S L.E.
More
Ergo Clears, custom WASD caps
| Das Pro
More
Costar model with browns
| GH60
More
Cherry Blacks, custom 3d printed case
| Logitech Illumininated | IBM Model M (x2)
Definitive Omron Guide. | 3d printed Keyboard FAQ/Discussion

Offline hanya

  • Posts: 132
  • Location: Japan
Re: Custom pcb no work :(
« Reply #3 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.
PFU HHKB JP, Sanwa MA-TB38 trackball

Offline nevin

  • Posts: 1646
  • Location: US
Re: Custom pcb no work :(
« Reply #4 on: Tue, 09 March 2021, 23:18:02 »
serial programmer right?
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline Kageni

  • Thread Starter
  • Posts: 24
Re: Custom pcb no work :(
« Reply #5 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.
« Last Edit: Tue, 09 March 2021, 23:39:54 by Kageni »

Offline nevin

  • Posts: 1646
  • Location: US
Re: Custom pcb no work :(
« Reply #6 on: Tue, 09 March 2021, 23:38:38 »
you'll still probably have the issue with the controller (no bootloader)
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline Kageni

  • Thread Starter
  • Posts: 24
Re: Custom pcb no work :(
« Reply #7 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 :(

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Custom pcb no work :(
« Reply #8 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.
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Rico

  • Posts: 105
Re: Custom pcb no work :(
« Reply #9 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.

Offline Applet

  • Posts: 488
  • Location: Sweden
Re: Custom pcb no work :(
« Reply #10 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
« Last Edit: Wed, 10 March 2021, 04:11:00 by Applet »

Offline Rico

  • Posts: 105
Re: Custom pcb no work :(
« Reply #11 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 ;)

Offline nevin

  • Posts: 1646
  • Location: US
Re: Custom pcb no work :(
« Reply #12 on: Wed, 10 March 2021, 06:01:02 »
Good to know. Thanks
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline Kageni

  • Thread Starter
  • Posts: 24
Re: Custom pcb no work :(
« Reply #13 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:

Offline nevin

  • Posts: 1646
  • Location: US
Re: Custom pcb no work :(
« Reply #14 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.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline Kageni

  • Thread Starter
  • Posts: 24
Re: Custom pcb no work :(
« Reply #15 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?

Offline Applet

  • Posts: 488
  • Location: Sweden
Re: Custom pcb no work :(
« Reply #16 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)

Offline Kageni

  • Thread Starter
  • Posts: 24
Re: Custom pcb no work :(
« Reply #17 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.

Offline Applet

  • Posts: 488
  • Location: Sweden
Re: Custom pcb no work :(
« Reply #18 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?
« Last Edit: Thu, 11 March 2021, 14:28:37 by Applet »

Offline Kageni

  • Thread Starter
  • Posts: 24
Re: Custom pcb no work :(
« Reply #19 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

Offline Kageni

  • Thread Starter
  • Posts: 24
Re: Custom pcb no work :(
« Reply #20 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.

Offline yui

  • Posts: 1082
  • Location: 127.0.0.1 (in azerty)
Re: Custom pcb no work :(
« Reply #21 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.
vi vi vi - the roman number of the beast (Plan9 fortune)

Offline Applet

  • Posts: 488
  • Location: Sweden
Re: Custom pcb no work :(
« Reply #22 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?
« Last Edit: Fri, 12 March 2021, 05:33:43 by Applet »

Offline Kageni

  • Thread Starter
  • Posts: 24
Re: Custom pcb no work :(
« Reply #23 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.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Custom pcb no work :(
« Reply #24 on: Fri, 12 March 2021, 18:07:08 »
The two pads on the crystal are connected together but are they connected to ground?
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Kageni

  • Thread Starter
  • Posts: 24
Re: Custom pcb no work :(
« Reply #25 on: Fri, 12 March 2021, 19:03:52 »
Not directly, they are connected to ground through the two capacitors only

Offline Applet

  • Posts: 488
  • Location: Sweden
Re: Custom pcb no work :(
« Reply #26 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

264345-0

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

Suggestion:
264347-1

Offline Kageni

  • Thread Starter
  • Posts: 24
Re: Custom pcb no work :(
« Reply #27 on: Sat, 13 March 2021, 11:47:55 »
Nice catch!! Thanks so much for all your help guys

Offline Rico

  • Posts: 105
Re: Custom pcb no work :(
« Reply #28 on: Sun, 14 March 2021, 13:31:01 »
Yay!

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

Well done!