0
\$\begingroup\$

I've been working on an ATmega32U4-based PCB for a custom keyboard for a while now. I made a few prototypes with similar designs, but they all seemed to have issues with the microcontrollers dying after a short while of use.

The symptoms are that the board works perfectly fine for a few minutes after first connected but then disconnects according to Windows. Unplugging and replugging the board results in another few Windows connect and disconnect sounds but with no response from the board. None of the keys I am activating are making it to the computer and hitting reset to put the controller into bootloader also results in no response.

I've included a few screenshots of the schematic and board layout below as well as a Google drive link with the BOM and the Kicad design files.

Any help would be greatly appreciated as this has been frustrating me for months now.

Note: I have changed one thing since my last prototype and the design files that I attached here. I had a trace crossing the traces going to the crystal on the top side of the board which I was advised could cause some interference. I changed that trace (labeled COL5) to now avoid crossing anything crystal related even if on the opposite side of the board.

enter image description here

enter image description here

enter image description here

enter image description here

\$\endgroup\$
9
  • \$\begingroup\$ What strategy are using for reading keys? Are you pulling rows low and then reading off the columns? \$\endgroup\$
    – jramsay42
    Aug 28, 2022 at 9:22
  • 3
    \$\begingroup\$ Is there a GND plane hidden or is this all the copper verbatim? \$\endgroup\$ Aug 28, 2022 at 11:09
  • \$\begingroup\$ How's the software? Or fuse bits? Are you actually using the external crystal and does it work? \$\endgroup\$
    – Justme
    Aug 28, 2022 at 15:05
  • \$\begingroup\$ @TimWilliams That is all the copper there is. It is kind of the bare minimum right now. \$\endgroup\$ Aug 29, 2022 at 3:14
  • \$\begingroup\$ @Justme I am using QMK firmware on the software side. As for the fuse, it is integrated in the daughterboard I'm using to connect to USB. The crystal should be used as dictated by QMK. I thought the 32u4 didn't have an integrated crystal so I have to use the external one. \$\endgroup\$ Aug 29, 2022 at 3:14

2 Answers 2

1
\$\begingroup\$

I always put TVS diodes on VBUS, D+ and D-, for example DRTR5V0U4S-7. As well as bypass capacitors and a series ferrite chip in series with VBUS, and I have never experienced problems with Atmega32U4.

\$\endgroup\$
3
  • \$\begingroup\$ This might be true, but likely TVS diodes being absent from data bus does not cause this. \$\endgroup\$
    – Justme
    Aug 28, 2022 at 10:06
  • \$\begingroup\$ @Justme TVS absent from +5V could cause damage from hot-plugging though, and the D+/- clamping is added value. \$\endgroup\$ Aug 28, 2022 at 11:13
  • \$\begingroup\$ Sorry I forgot to mention, I am using a daughterboard to connect the board to USB. The daughterboard has a TPD4E05U06DQAR for ESD protection, fuse, TVS diode for VBUS, and a ferrite bead inductor. It is the Unified Daughterboard designed by ai03 and a few other experienced keyboard designers for reference. \$\endgroup\$ Aug 28, 2022 at 16:49
-1
\$\begingroup\$

Given the symptoms you have described, and your schematic, the first thing I can think of is that you may be exceeding the maximum current on the I/O ports.

There is a maximum for individual pins, and the datasheet indicates the sum of currents for certain combinations of pins should be < 100 mA.

\$\endgroup\$
3
  • \$\begingroup\$ It is scanning a matrix. How would that exceed rated pin current by itself? Except if the buttons are pushed and it shorts incorrectly configured IO pins. \$\endgroup\$
    – Justme
    Aug 28, 2022 at 9:26
  • \$\begingroup\$ Is there a “correct” way to configure to IO pins in a matrix like this? Are there certain pins that can’t be shorted together? Sorry I’m not that well versed on the actual specifics behind the ATMega32u4 \$\endgroup\$ Aug 28, 2022 at 17:07
  • \$\begingroup\$ @AndrewChao If COL are driven then how are you pulling down the ROW signals? ATMega32u4 has no pull-downs and I see none on the schematic. I hope they aren't hard driven low? \$\endgroup\$ Aug 29, 2022 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.