MCU sinks current when off

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
carrino
Level 2
Level 2
10 sign-ins 5 replies posted First reply posted

I have a pin I am using to read the voltage of my battery.  It is divided by a couple of resistors.  Let's name it BATT_VDIV.  This signal also is run to my 3.3V voltage regulator enable pin.  

The board works fine the first time it is powered on and when it is running.  However, the issue is that once the Psoc connects that pin to the ADC it ends up sinking current when it is off.  I have added a mux switch in there to prevent this, but if I turn the board off while the BATT_MUX switch is enabled, the vreg will never get a high enough voltage to power it back on.

 

Is there a way to guarantee this mux gets unhooked before the board is turned off. Maybe some brownout handler or something.

 

 

11 Replies
carrino
Level 2
Level 2
10 sign-ins 5 replies posted First reply posted

It seems like the mux thing may be a red herring.  In either configuration it sinks current when off.  When the switch is ON, the voltage difference from BATT_VDIV and GND is 278mV.  This is not enough for the voltage regulator which needs 1.45V to enable.  I've run into other issues with LEDs remaining on because the board sinks current when it is off.  Is there any work around to prevent this from happening?

RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

If you have a pin to spare, I would rather connect the R_1 to a pin than directly to the ground. Even if the BATT_VDIV is a high impendence input, some current will leak through the divider resistors. You can configure the new pin as open-drain drives low. When you need to measure the voltage of the battery, you can set the pin to LOW, which means is grounded. When not using, set the pin to HIGH, so it is floating, so no current will pass through. There is no need to have the BATT_MUX and MUX_CONTROL.

See figure below:

RodolfoGL_0-1669264933402.png

 

0 Likes
The main issue is that the pin sinks current when the board is off. If I
short the battery to this pin it's on the order of 12mA of sinking
current. Therefore the voltage regulator never is enabled and so the board
never gets the chance to turn on.
0 Likes
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

Where does the 12mA current come from?

When the board is OFF, is there a physical switch between the battery and the voltage regulator? Even if there is a short on the PSoC when it is power down, there is this 1MOhm resistor to limit the current.

It might be helpful if you share the voltage regulator circuit as well.

0 Likes
lock attach
Attachments are accessible only for community members.
carrino
Level 2
Level 2
10 sign-ins 5 replies posted First reply posted

I have attached a new schematic with the VREG in there.   I can assure you that when powered down (i.e. the vreg is disabled), the chip does sink current, and way more than a 1MOHM would allow.  This seems to be true on all pins as far as I can tell (even the OVT ports).  I'll see if I can make a small video where this is clear.

0 Likes
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

Thanks for sharing more info.

I don't understand why the enable of the regulator is connected to the divider circuit of the battery.

Because you have a physical switch there, I don't think you need a regulator with enable pin. Below you see a typical voltage regulator circuit:

RodolfoGL_2-1669331961746.png

If you can't change the regulator to one without enable, you might want to use a different divider circuit to be connected to the enable of the regulator. Because at the moment you power the PSoC, the internal resistance impendence will change at the moment you configure the pin, and that can drop the voltage on the enable signal, shutting down the regulator. You can check the output of the regulator, the voltage is probably oscillating. The regulator might be transitioning between on and off all the time, which might explain the high current.

0 Likes
carrino
Level 2
Level 2
10 sign-ins 5 replies posted First reply posted

Here is the absolute minimal example I could come up with.  I have many photos attached.  

Battery_NEG is attached to GND.  Battery_PLUS  is wired to 560 OHM resistor.  Resistor is wired to multimeter black lead.

Now with red lead I probe the other pins and see what happens. Surprise!  They ALL SINK CURRENT!

 

Here is the setup: 

PXL_20221125_054958265.jpg

 

here are 9.0 - 9.4

PXL_20221125_055033891.jpg

PXL_20221125_055037427.jpg

PXL_20221125_055041307.jpg

  

PXL_20221125_055044926.jpg

PXL_20221125_055048465.jpg

  

  

 

Now I power the MCU on by plugging in a microUSB and repeat 9.0 - 9.4

 

PXL_20221125_055118521.jpg

PXL_20221125_055122947.jpg

PXL_20221125_055128854.jpg

PXL_20221125_055138046.jpg

   

PXL_20221125_055142242.jpg

 

HighZ must not mean High Z how I understand it or there is something else going on.  What am I missing?

 

0 Likes
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

If the PSoC is powered off, some current will pass through the pins, there is nothing you can do about. It doesn't matter how the pin was configured, that configuration is not enforced if you are not powering the PSoC. 

When the PSoC is powered on, even if you set a pin as HighZ, still some current will pass through, but not much. Based on your experiment, you can see the input impendence is around 50 kOhm. 

Please review my previous post and try those suggestions and see if it fixes your issue.

0 Likes
carrino
Level 2
Level 2
10 sign-ins 5 replies posted First reply posted

I think there is a common misconception that when a psoc is off that the pins are high-Z.  Is there a more precise description of the state of the pins when off than "some current will pass"?

0 Likes
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

This is the internal PSoC pin circuit:

RodolfoGL_0-1669390945350.png

Even if there is no power on PSoC, some current can still go through the protection diodes on the right. In your case, I'm suspecting it go through the Vdd diode. Can you measure the resistance between the Vdd and GND on your board (without applying power)? Based on the current you are measuring, it should be around 1.5kOhms.

 

0 Likes
carrino
Level 2
Level 2
10 sign-ins 5 replies posted First reply posted

From what I can measure there isn't any significant resistance, but a voltage drop of 450mV or so presumably through a diode.

I did break the circuit up into 2 distinct voltage dividers (one for the psoc and one for the voltage regulator). 

0 Likes