0
\$\begingroup\$

I have some modules, each with their own STM32 MCU, connected on the same power supply. These modules are communicating via UART.
When plugging in multiple units I get the problem that modules are seemingly randomly breaking down. They still work (the LCD lights up) but the STM32 chip gets very hot and draws a lot of power.

At first I thought it would maybe be overshoot at the power supply rail from hotplugging that caused these failures, but when further investigating (I now only have broken modules left,) I found that there was a substantial current of 0.1A running over the UART lines.

I have the theory that when one board is not powered it draws current via the UART port protection diodes, and this is what breaks the board supplying this power since it needs to deliver the full power of a board via its RX pin. I made a schematic explaining this:

enter image description here

Is this something that could break my STM32? It is something that happens very quickly because the board does not seem to power up from this current.

What would be the best way to fix this issue?

\$\endgroup\$
7
  • \$\begingroup\$ Plain UART, no RS232/RS485? What voltage levels? How are things supplied and grounded, more exactly? The protection diodes wouldn't draw any current unless you have the wrong supply/ground. And yeah you shouldn't source/sink more than some 20mA at best per MCU pin. \$\endgroup\$
    – Lundin
    Commented Apr 30 at 10:15
  • \$\begingroup\$ Yes plain TTL UART on 3.3V, every modules only needs to communicate in one direction, for that reason every modules TX is only connected to every modules RX and so on. So only 1 line communication. \$\endgroup\$
    – luukito
    Commented Apr 30 at 10:17
  • 2
    \$\begingroup\$ Just to recap, you are hot-plugging modules together in a way that allows IC data pins to connect together before GND and VCC connect? What connector you use and what is the supply on those connectors, 5V? Also, if possible, which exact STM32 pins you are using - different pins have different electrical properties that may affect the scenario. \$\endgroup\$
    – Justme
    Commented Apr 30 at 10:20
  • \$\begingroup\$ Yes, that is correct under normal circumstances data and power would connect at the same time but while testing they could be connected in different order. In a connector data could potentially also be connected slightly before the supply. The supply is 24V which is reduced by a buck-converter to 3.3V \$\endgroup\$
    – luukito
    Commented Apr 30 at 10:24
  • \$\begingroup\$ Oh yeah hot-plugging low TTL signals when supply and/or ground might not be immediately connected is a good way to fry stuff (I'm an expert at doing that...). Series resistors on every signal towards every connector pin are good for mitigating all manner of problems like that. Also good against ESD and accidental shorts. \$\endgroup\$
    – Lundin
    Commented Apr 30 at 10:26

1 Answer 1

1
\$\begingroup\$

Yes, what you are doing will destroy MCUs when plugged in.

You have 24V supply, GND, and data wire between modules.

Assuming your modules have a regulator to convert 24V to 3.3V for MCU, there must be a capacitance between 24V and GND, and also capacitance between 3.3V and GND.

When a module is disconnected, it has no power and capacitors are discharged - so every node on module has 0V with regards to module ground.

If you hot-plug that into another live module, and the 24V supply connects first, the data line and ground of unpowered module are also at 24V.

So if data wires connect next, there will be 24V on the powered MCU data pin and the unpowered module capacitors start charging with large inrush current.

If the connector does not prevent it, then it will be difficult to add protections on the board to prevent it.

One option is to not hotplug them, turn power off before connecting or disconnecting.

This is exactly why USB and many other connectors intended for hot-plugging are designed so that grounds and supplies connect first, then data.

\$\endgroup\$
5
  • \$\begingroup\$ Thank you for your response. Would a resistor in series with the dataline not prevent this inrush current from happening or would this not be a sufficient solution? \$\endgroup\$
    – luukito
    Commented Apr 30 at 11:14
  • \$\begingroup\$ @luukito It depends on which exact MCU and what exact pins on it you use. I have no clue if you used 5V tolerant IO pins or normal IO pins. Assuming you used normal IO pins, and used an STM32 which requires injected current limited to 5mA, you need 4800 ohm series resistor, and UART through 4800 ohms does not sound very feasible. 5V tolerant pins don't have diodes to supply so you need something else anyway. And outputs being high do not like to be pulled up to higher voltage anyway. \$\endgroup\$
    – Justme
    Commented Apr 30 at 11:31
  • \$\begingroup\$ "This is exactly why USB and many other connectors intended for hot-plugging are designed so that grounds and supplies connect first, then data." I've managed to hot plug an USB A connector so that supply was connected before ground - don't ask me how, takes skill :) But it was enough to fry the PCB. So I wouldn't trust the connector but to design the signals to be rugged, with series resistors indeed. \$\endgroup\$
    – Lundin
    Commented Apr 30 at 11:45
  • \$\begingroup\$ @Lundin I guess that is possible. However, generally USB devices are expected to handle scratchy connections and generally have some protection on data pins, instead of nothing. The voltage is also generally 5V, except with Type-C, the receptacles are not allowed to output any voltage until connection and role of the device is detected. \$\endgroup\$
    – Justme
    Commented Apr 30 at 12:04
  • \$\begingroup\$ This was a "quality" consumer PCBA from China, but I'm still proud to have managed. \$\endgroup\$
    – Lundin
    Commented Apr 30 at 12:33

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.