Skip to content

Current leaks / possible laptop card damage / enumeration issues #1

@amstan

Description

@amstan

Hey,

Thanks for sharing the schematic.

I think you're causing a current leak, which might be bad in some ways (to the point of breaking your framework laptop and/or CH340).

To begin, some definitions:

  • You're going to insert this expansion card into a framework laptop you want to debug (aka DUT)
  • You're going to plug this expansion card into another laptop/host that will have a serial monitor (let's call this workstation)

Essentially you have 4+2 power situations:

  1. DUT on, workstation plugged
  2. DUT on, workstation unplugged (eg: you left your debugger in a laptop in a bag)
  3. DUT with battery unplugged, workstation plugged
  4. DUT with battery unplugged, workstation unplugged
  5. expansion card not plugged into DUT, workstation plugged
  6. expansion card not plugged into DUT, workstation unplugged (you ship this way ;)

1 and 4 are happy.
3 is rare, but kinda bad.
2 is quite bad because it happens often.
5 and 6 are fine too.

How to reproduce:

  • Start from situation 6
  • Insert your expansion card into a framework laptop (situation 2)
  • Insert your workstation into the debug expansion card (now moving to situation 1)

What should happen:

  • Things are fine in situation 2
  • CH340 enumerates over usb once you insert into workstation

What actually happens

  • Current leak while in situation 2, potentially causing hardware damage
  • CH340 does not enumerate when you move to situation 1

Workaround: Never plug in expansion card into the DUT first, plug it into workstation first (situation 5), plug it into your DUT (5->1) and hope your laptop's battery is fine (avoid situation 3).

Workaround when you forget and you already did a 2->1: undock expansion card from laptop (move to situation 5), plug it back in (now moving to situation 1 again)

Here's a falstad link that can simulate Situation 1 2 3 and 4 with: https://tinyurl.com/yw3qgb6n
How to use:

  • By default you're in situation 1
  • Switch any of those power switches away to GND (causing situation 2 or 3)
  • If you see lots of current going through the resistors, there's a current leak happening, potentially stressing out some/all of the pins.

What are those diodes? https://www.ti.com/document-viewer/lit/html/SSZTBV4, they're not meant to carry current. If you look through chip datasheets, most chips will have something like `ViH (max input voltage on a pin) <= Vcc+0.5V", in the case where the chip is off, now your Vcc is actually ==0V, so you shouldn't give 3.3V on a pin. This effect is what lets https://hackaday.com/2009/06/27/avr-rfid-tag/ work, but that should not be used in production, you'll be ignoring maximum chip ratings as I just mentioned. (BTW: I'm looking for a a hackaday link where someone took an AVR, cut off most of the pins except the middle area(where the die is), including the VCC and GND pins, but the chip could still be "used" because of this same effect)

Why are those resistors 1 ohm? Why are there resistors at all? You need a resistor to be able to simulate that circuit. In real life your wire resistance is lower, but each pin (and diode) has some resistance too.

How can you fix kinda quickly, but hackly? Add series resistors (just like those 1 ohm resistors) on each of your signal wires, 100ohm might be enough, but higher is better for leaking (though worse for signal integrity).

How can you fix this properly? Add a voltage buffer chip (ex: SN74AVC4T774RSVR), VCCA side powered by the CH340's power supply, VCCB from an extra 3.3V supply that's powered from the DUT's USBC's (P1) VBUS connector.

PS: This is what @DHowett's blog post is talking about when he says "leak".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions