0
\$\begingroup\$

In previous designs, I have used an MCU digital output to drive the lower side of a resistor ladder to the supply voltage, to prevent power consumption when the ladder is not being sampled:

Schematic 1:

schematic

simulate this circuit – Schematic created using CircuitLab

This led me to wonder (in the schematic below):

If the MCU supply (VCC) was 3.3V, and the supply on R3 was 5V, driving the output HIGH would still result in current flow into the MCU. Would sinking current (through M1) when the output is driven HIGH be a problem? My understanding is that typically, when it is desirable to sink current, the output should be driven low (for current to flow to GND through M2).

Does this present a fundamental problem with how CMOS digital outputs are meant to be used? Can current be "sunk" to VCC? Would this cause problems with the intrinsic body diode of the P-Channel M1 always conducting some current, and is that an issue?

Schematic 2:

schematic

simulate this circuit

\$\endgroup\$
  • \$\begingroup\$ Look up the MCU specifications for the maximum protection diode (clamp) current. This figure will usually be in the very low mA range or perhaps 100's of uA. For example, page 57 for the PIC10F200 shows 20 mA. You should stay well under such figures. \$\endgroup\$ – jonk Jul 27 '18 at 6:12
0
\$\begingroup\$

Would sinking current (through M1) when the output is driven HIGH be a problem?

Depends highly on the MCU in question. Most MCUs have much more complex pin circuitry in place - to prevent ESD or latchup for example.

A small current flow into the MCU ist usually not a problem, but there is a catch: Modern MCU can sleep with very low current flow (single digit µA and below). A higher current flow into the MCU could thus rise VCC above tolerable levels - possibly damaging the chip.

Note that you dont't need to enable the high side output on the GPIO for your application at all. Just set the pin to input mode when you turn off the low side. Some µCs allow 5V on a GPIO pin (sometimes only when VCC is present). Be sure to check the datasheet.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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