12
\$\begingroup\$

I have a custom ARM Cortex M3 board that communicates with a Raspberry Pi 4 via UART. Only three wires connect the Pi to the MCU: Tx,Rx,GND. When the MCU power supply is turned off the device does not power down but draws 17mA from the Rx pin and is able to bring the 3.3V rail up to 1.7V which is enough to keep the MCU running, or at least prevent it resetting. Presumably this is via the protection diodes when the 3.3V supply is powered off.

The Pi and MCU run off independent power supplies but are mounted in the same chassis and share a ground. The UART cable is only 10cm long between them.

What is the correct way to isolate power between these devices while allowing UART communication? I don't require galvanic isolation, I just want to prevent the power supply backflow. Any suggestions?

I currently have 1kΩ resistors in series with the Rx and Tx lines which is keeps the MCU from powering from the Pi, however there is still current flowing to the 3.3V bus and I don't know if this will adversely affect serial data.

(Edit: I want to emphasize the general nature of this question. It is common to have push-pull interconnects between devices with interfaces like SPI, UART, or just GPIO bits. These all have the potential to feed power to an unpowered device via the protection diodes.)

\$\endgroup\$
7
  • \$\begingroup\$ What is the baud rate? \$\endgroup\$
    – devnull
    Commented Apr 18, 2022 at 20:13
  • 1
    \$\begingroup\$ Why do you have to isolate anything? When the MCU is powered down, just change the TXD output that is driving high to either drive low or input. That's a software solution requiring no hardware. \$\endgroup\$
    – Justme
    Commented Apr 18, 2022 at 20:23
  • \$\begingroup\$ Baud rate is 115200, but it I might use at up to 400kbaud if it is stable. \$\endgroup\$
    – Mike
    Commented Apr 18, 2022 at 20:29
  • 4
    \$\begingroup\$ The power is inadvertently being supplied by the Raspberry Pi TX (GPIO14) pin 8. I'm not sure if the UART can be disabled and this pin driven HighZ in software. Also the Pi does not know that the MCU is powered off. \$\endgroup\$
    – Mike
    Commented Apr 18, 2022 at 20:31
  • \$\begingroup\$ Congratulations. You have grasped the problem and that is 99% of the solution. \$\endgroup\$
    – user57037
    Commented Apr 18, 2022 at 20:54

3 Answers 3

9
\$\begingroup\$

There are buffers that will fix this (search term: "ioff partial power down"). As long as the buffer is powered from the custom Arm board VCC, it will block current when VCC is absent.

But you can also fix it with two transistors, a PMOS such as the BSS84 and an NMOS such as the BSS138. See schematic below. Use VCC on your custom Arm board to turn on the BSS138. This will, in turn, turn on the BSS84 so the signal can get through.

But when VCC is not present, the BSS138 will turn off, and then the BSS84 will also turn off, and no current can flow from PI_TX to PI_TX_SW. R2 is probably not needed. There is probably something already in between VCC and GND that will cause VCC to collapse.

This is the concise version of the answer because I am judging that your experience level is pretty advanced already. However, please feel free to request elaboration or clarification in the comment section if desired.

If it is not necessary to be frugal with power on the PI side, you can change R1 to 10 kohm or so.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
6
  • \$\begingroup\$ This will work OK as long as VCC is 3.3 or 5 V. It will not work reliably at VCC = 1.8 V for example. \$\endgroup\$
    – user57037
    Commented Apr 18, 2022 at 21:13
  • \$\begingroup\$ +1 Cool solution. Will R1 affect switching speed? \$\endgroup\$
    – devnull
    Commented Apr 18, 2022 at 21:15
  • \$\begingroup\$ Thank you, this is the kind of solution I was looking for. I'll look for an ioff buffer that can do this in a turnkey way. I figured there was a simple discrete transistor solution but I couldn't quite work it out. \$\endgroup\$
    – Mike
    Commented Apr 18, 2022 at 21:22
  • \$\begingroup\$ I'm about to respin my ARM board (if I can find any of the parts) so glad to know the right way to solve this isolation problem. \$\endgroup\$
    – Mike
    Commented Apr 18, 2022 at 21:22
  • 2
    \$\begingroup\$ @devnull I don't think so. Or not much. I think the speed limit will be the miller capacitance in the BSS84. The problem with the 470 k is that if there is any leakage current in the BSS138, then maybe the BSS84 will start to turn on a little bit when we don't want it to. I think 470 k will be OK, but I wouldn't go much higher. \$\endgroup\$
    – user57037
    Commented Apr 18, 2022 at 21:28
3
\$\begingroup\$

The classic way is to use a "4050" (example) to buffer the incoming signal. A 4050 doesn't pass power from input to Vdd. Vdd should connect to the M3 board's power. There are many more modern "level translator" chips you could also use.

\$\endgroup\$
4
  • \$\begingroup\$ The 4050 might behave this way in practice but I don't see anything in the datasheet to indicate the kind of "Ioff" behavior described by @mkeith above. Maybe I missed something. \$\endgroup\$
    – Mike
    Commented Apr 19, 2022 at 18:30
  • 1
    \$\begingroup\$ @Mike See Figure 6 in the data sheet. The input is missing the diode to Vdd that's normally present in CMOS. That diode is the path passive power follows. \$\endgroup\$
    – John Doty
    Commented Apr 19, 2022 at 18:35
  • \$\begingroup\$ I wonder if the same diode is used for the 16V overvoltage protection with a low reverse breakdown. Of course these datasheet schematics are representative of behavior, not the actual implementation. \$\endgroup\$
    – Mike
    Commented Apr 19, 2022 at 18:56
  • 2
    \$\begingroup\$ @Mike Standard CMOS clips overvoltage to the supply rails through diodes. A 4050 does that to the negative rail, but yes, uses diode breakdown for positive clipping. This isn't as effective, and 4050s are known to be somewhat more ESD damage-prone than standard CMOS \$\endgroup\$
    – John Doty
    Commented Apr 19, 2022 at 19:05
3
\$\begingroup\$

Maybe put in a tri-state non-inverting buffer on the TX line. Like a SN74AHC1G125 or similar. Use a pullup on /OE to the Pi and drive it actively low with the MCU.

\$\endgroup\$
6
  • \$\begingroup\$ This sounds like it might be the right way to go. But does the buffer suffer the same problem if Vin>Vcc when the MCU is turned off. If the OE=Lo the output is off, but will the input overvoltage protection feed back to VCC? \$\endgroup\$
    – Mike
    Commented Apr 18, 2022 at 20:40
  • 1
    \$\begingroup\$ To be safe you could look for 125 buffer alternatives with Ioff functionality like this: farnell.com/datasheets/2192952.pdf It prevents backwards flow when VCC is low. \$\endgroup\$
    – Dejvid_no1
    Commented Apr 18, 2022 at 20:49
  • 2
    \$\begingroup\$ Buffers designed to provide isolation when powered off will use this magic word "ioff" or often the magic phrase "ioff partial power down." So if the OP searches for those magic phrases, enlightenment will surely follow. \$\endgroup\$
    – user57037
    Commented Apr 18, 2022 at 20:53
  • 1
    \$\begingroup\$ Just keep buffer powered and turn the output off with OE pin. \$\endgroup\$
    – Justme
    Commented Apr 18, 2022 at 21:44
  • 1
    \$\begingroup\$ The OE thing could work if you keep the buffer powered up. In that case you don't need IOFF. You power the buffer from the PI side, and OE comes from the custom arm board side. If you go the IOFF route, then you power the buffer from the arm side and don't need OE. I think this second option is cleaner. Because (I assume) you are going to put the buffer on the arm board. With the IOFF option you don't need VCC from the PI side at all. \$\endgroup\$
    – user57037
    Commented Apr 19, 2022 at 4:35

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.