Quentin Santos

Obsessed with computers since 2002

Author: Quentin Santos

  • The RP2350-USB-A cannot see devices disconnect

    The RP2350-USB-A cannot see devices disconnect

    What’s better for New Year’s Eve than debugging some USB hardware issues?

    In my previous article, I explained how the design of Waveshare’s RP2350-USB-A can make the USB-A host connector incapable of detecting certain USB devices, and of any hot-plugging. The solution was to desolder R13, a pull-up resistor on D+:

    With this fix, my RP2350-USB-A was able to detect when I connected a keyboard to the USB-A port, and to receive keypresses.

    However, I noticed another issue: when disconnecting the keyboard, the board would not detect that it happened. When connecting the keyboard again, it would often not work at all, unless I reset the board.

    The reason is that the USB-A circuitry is still not compliant with the requirements of a USB host. Specifically, the host side should have weak pull-down resistors on D+ and D-:

    From the venerable USB in a NutShell

    Without this, the voltage level of D+ and D- remains “floating”. That is, the value is not well defined. In practice, it was close enough to GND at boot, that the board could see the device pulling D+ (or D-) up. However, when disconnecting the keyboard, the charge in D+ (or D-) would have nowhere to go, and the voltage would likely not return to GND.

    To test this, I made a small gadget out of some male and female USB connector breakout boards:

    The wires simply connect GND to GND, D+ to D+, D- to D- and VBUS to VBUS between the two breakout boards. A single breakout board with a male and a female connector would be even better, but this is what I had lying around.

    The magic lies on the back:

    Under the female connector breakout board, I soldered a 15 kΩ resistor between GND and D+. Under the male one, the same between GND and D-. I put one resistor under each board to avoid having to fit both resistors under the same board.

    I just plug the gadget between the RP2350-USB-A and the keyboard (on the right):

    The resistors on the back of the breakout boards act as the missing pull-down resistors for D+ and D- on the host circuitry.

    When I disconnect the keyboard from the gadget (not the gadget from the RP2350-USB-A, as the gadget complements the host), the RP2350-USB-A has no problem detecting it!

    This will do for experimenting but, for a cleaner solution, I would go with soldering an SMD resistor between the D+ and GND pins, and maybe a through-hole resistor between the D- and GND pins, directly on the pads of the USB-A connector of the board.