0
\$\begingroup\$

I am using this 3.3V LDO whose input Vin=5V (regulated input.) Output is 3.3V with load current of 200mA

This 3.3V is given to this Microcontroller for GPIOs.

I have taken 2 outputs (these are sctive Low signals during normal operation and must be active high during sleep) from this 3.3V GPIO domain and connected to another IC with a +5V pullup. (Connected the +3.3V port to a +5V pull-up to meet the Vih/Vil levels of the connected IC and due to lack of +5V GPIO ports)

These two outputs are configured as open drain outputs (with no internal pull-up enabled inside the micro,) as we have pullups outside the micro, snd these are fed to the IC.

Micro is driving these two outputs as active high during sleep time.

During microcontroller sleep state, I am observing +4.2V at the 3.3V LDO output cap.

What might be the reason? Why am I getting +4.2V instead of +3.3V at the LDO output?

During normal operation, it works fine. I am getting only +3.3V at the LDO output. Main concern is only during the sleep state.

Does the internal clamping diode inside the micro do something (create a sneak path?) Can I infer something from the internal LDO Architecture?

I have attached a simple crude image of my problem. Please check.

What could be the reason and what could be a possible solution to overcome this?

Circuit

Thanks

\$\endgroup\$
2
\$\begingroup\$

Your fundamental mistake is in thinking that you can pull output pins up to a higher voltage than the MCU is operating at. With conventional outputs, that not only will not work, but it is something you should not even try to do.

Your MCU's data sheet specifies that an input pin is not allowed to be more than 0.3 volts above the supply pin. When you exceed that, the protection diode will become forward biased, and an injection current will flow from the I/O pin into the supply rail. The data sheet does allow you to inject up to 10 mA per pin (and 50 mA total). But the thing to realize, is that the only way this will get your outputs more than 0.3v closer to 5v, is if the injection current raises the entire board power net.

As Bruce already explained, during run your MCU consumes enough power to absorb the injection current (the regulator simply sources less). You are stressing the protection diodes, and not really achieving anything useful by doing this, but it may appear as if it "works".

However, when your MCU power drops in sleep mode, now your are not absorbing the injection current, and the supply rises. Ironically, this puts less stress on your MCU, since it is rated for 5v operation, and the more the supply rises, the less current flows.

Ultimately, your issue is not with sleep mode, your issue is with faulty design for run mode.

You should abandon this idea of pulling the outputs up to a higher voltage - if you want to do that, you need an open collector without protection diodes (ie, something with the topology of the ULN2803).

But what you really should do is build a proper level shifting circuit, or use a buffer rated to interpret 3v3 signals when powered at 5v, such as something from the 74HCT family.

\$\endgroup\$
  • \$\begingroup\$ Since the OP appears to only be doing this with two signals, it may be easy to add discrete N-channel MOSFETs (2N7002 or BSS138), just note that this will invert the signals. \$\endgroup\$ – Caleb Reister Sep 28 at 21:44
  • \$\begingroup\$ @CalebReister if they wire the MOSFET as a level translator rather than a switch it won't invert. See for example the old AN97055 cdn-shop.adafruit.com/datasheets/an97055.pdf (NXP no longer seems to publish the full version only a shortened one) \$\endgroup\$ – Chris Stratton Sep 29 at 1:47
  • \$\begingroup\$ I thought of that, but it requires an extra resistor. \$\endgroup\$ – Caleb Reister Sep 29 at 2:58
  • \$\begingroup\$ Isnt the microcontroller a problem? Why is the voltage supply going from 3.3V to 4.2V which I have clearly configured the GPIO as Open Drain "Output" ? I understand, if the Pin is configured as Input. But how come the voltage builds up even when I have configured as Output? \$\endgroup\$ – Newbie Sep 30 at 11:20
  • \$\begingroup\$ The protection diodes are a permanent feature which exist regardless of the configuration by software. You cannot use a protected pin open drain with a higher voltage I'm this way. \$\endgroup\$ – Chris Stratton Sep 30 at 12:15
1
\$\begingroup\$

Does the internal Clamping diode inside Micro do something (create a sneak path) ?

Yes. We can deduce this from the I/O pin voltage rating of Vdd + 0.3V max.

Can I infer something from the internal LDO Architecture?

Most regulators can source significant current, but not sink it. So an external current applied to the output will cause the voltage to rise above normal if it exceeds the sink current (or minimum output current for regulation).

You may not notice this in normal operation because the MCU is drawing enough current to keep the voltage down. When it goes to sleep it draws much less, so the injected current from the pullups causes the voltage to rise. In this case it may be safe in sleep mode since the MCU is rated to operate on +5V, but when awake the 'sneak' current could be higher, stressing the protection diodes.

Even it doesn't damage anything the injected current could cause intermittent misoperation. You should either change the I/O voltage to 5V, or install level shifters.

\$\endgroup\$
  • \$\begingroup\$ This is a good explanation of why the issue is happening, but you do not suggest a solution. \$\endgroup\$ – Caleb Reister Sep 28 at 7:11
  • \$\begingroup\$ Could you please explain your second para in a bit simpler terms. I am unable to understand the direction of current flow during the sleep condition and how it builds up. It would you helpful if you could explain a little more detail and simpler. \$\endgroup\$ – Newbie Sep 28 at 7:12
  • \$\begingroup\$ lets say the MCU normally draws 10mA. But the pullup resistors are injecting about 0.5mA into it, so the regulator only has to supply 9.5mA. Then the MCU goes to sleep and only draws 0.1mA. Now we have 0.4mA with nowhere to go. The regulator can't sink it so it can't hold the voltage down. \$\endgroup\$ – Bruce Abbott Sep 28 at 8:48
  • \$\begingroup\$ You measured 4.2V on the 3.3V Vcc line. The MCU's protection diodes drop ~0.6V so the pullup resistors must have 5V-0.6-4.2V = 0.2V across them, and each one is supplying 0.2V/4.7k = ~0.04mA. That means the MCU in sleep mode is drawing ~80uA. The regulator might be drawing some of this current passively, but is not regulating the voltage because it can only 'pull' up, not down. \$\endgroup\$ – Bruce Abbott Sep 28 at 9:08
  • \$\begingroup\$ Thank you very much for the detailed explanation. In addition to your last line of the previous comment, could you please make it simpler for me. And could you comment on the Internal LDO architecture, on how the feedback loop of the LDO operates during these senarios for better understanding. Thank you \$\endgroup\$ – Newbie Sep 28 at 12:47

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.