VREG enable control from multiple sources

The link to the schematic is

formatting link

My requirement is to enable the regulator when BATT_12V (12V) is present AND/OR GPIO from MCU is HIGH (3.3V). Disable only when BATT_12V not present and GPIO is Low (0V).

Max input to Enable pin is 6V. Leaving Enable pin floating or > 1.6V enables the regulator.

1) Will the above schematic work?

Also note from the schematic that the GPIO from MCU will turn Low to switch off the power to itself by disabling the regulator. Once power down the MCU can only be powered up by applying BATT_12V power.

2) Will there be any instability when the MCU turns GPIO Low and regulator is disabled cutting off supply to MCU? How to add little delay (say 200 ms ) to bring Enable pin Low after the GPIO becomes Low to allow MCU to shutdown properly?

3) Will R5 keep Enable pin at Ground (prevent floating) when BATT_12V not present and GPIO is Low?

4) Any potential issues with this design?

Thanks

-mj

Reply to
mj
Loading thread data ...

AND/OR GPIO from MCU is HIGH (3.3V). Disable only when BATT_12V not present= and GPIO is Low (0V).

les the regulator.

witch off the power to itself by disabling the regulator. Once power down = =A0the MCU can only be powered up by applying BATT_12V power.

r is disabled cutting off supply to =A0MCU? How to add little delay (say 20=

0 ms ) to bring Enable pin Low after the GPIO becomes Low to allow MCU to s= hutdown properly?

present and GPIO is Low?

Hmm, why are you working so close to the turn off 1.8 V vs 1.6... sounds like it could get flaky. You could run the mcu without the voltage divider resistors, and divide the battery voltage down to only

3.3 V or something like that. I assuming that you are sensing the difference between a 12 V battery and no battery. If you want to sense the difference between a 12V battery and a 10 V battery, then you will have to do a bit more.

For a time delay an RC lowpass is pretty simple.

George H.

Reply to
George Herold

AND/OR GPIO from MCU is HIGH (3.3V). Disable only when BATT_12V not present= and GPIO is Low (0V).=20

les the regulator.

tch off the power to itself by disabling the regulator. Once power down th= e MCU can only be powered up by applying BATT_12V power.=20

r is disabled cutting off supply to MCU? How to add little delay (say 200 = ms ) to bring Enable pin Low after the GPIO becomes Low to allow MCU to shu= tdown properly?

present and GPIO is Low?

It's good except for not having that 200ms turn-off one shot. I think it's = simpler to just use a logic chip. The circuit below shows how to do it with= a quad NAND, and it has to be a Schmitt trigger type to reliably handle th= e really long one-shot time-out. This means something like a 74HC132, which= you can run off a 3.3V supply derived from your 16V unregulated source. I = am assuming the GPIO is 3.3V CMOS compatible, and also that you're not all = that concerned with the precision of the 12V battery voltage level. SD mean= s Schottky diode. Please view in a fixed-width font such as Courier.

. . . . LOGIC TRANSLATED DIRECTLY FROM VERBAL . . . . ________ __ . ____ ____ BATT_12V----o| \ __ . GPIO --+---------o\ \ | o---EN . | | >o -------------o|__/ . | .---o/___/ . | | . | '--------------------. . | | . | ONE-SHOT | . | -------------- | . | | | | . '----o|>TRIG OUT|o----' . | | . -------------- . . 200ms . --- ---- . | | . | | . -------- . . . . . CONVERSION TO NAND LOGIC 74HC132 . . . . 3.3V . | . | . [100K] . | . +---------. . | | . |/ | . 12V Battery >-[150K]-+---| | ________ . | |> | BATT_12V . [10K] | | . | | | . | | | . --- --- | . | . | __ . __ '---| \ . GPIO --+----------| \ | o ----EN . | | o---------------|__/ . | .----|__/ . | | . | | . | | 200ms . | | --- ---- . | | | | . | | ONE SHOT | | . | | -------- . -- | '---------------+--------------. . | | | | . | | | __ | . --- | '--| \ | . | 100p | o---. | . '------------||--+-------|__/ | | . | =3D=3D=3D | . .--|

Reply to
bloggs.fredbloggs.fred

formatting link

AND/OR GPIO from MCU is HIGH (3.3V). Disable only when BATT_12V not present and GPIO is Low (0V).

the regulator.

off the power to itself by disabling the regulator. Once power down the MCU can only be powered up by applying BATT_12V power.

disabled cutting off supply to MCU? How to add little delay (say 200 ms ) to bring Enable pin Low after the GPIO becomes Low to allow MCU to shutdown properly?

present and GPIO is Low?

If that GPIO goes HI-Z when you power down, then hang a 100K to GND off it.

Reply to
bloggs.fredbloggs.fred

t AND/OR GPIO from MCU is HIGH (3.3V). Disable only when BATT_12V not prese= nt and GPIO is Low (0V).

ables the regulator.

switch off the power to itself by disabling the regulator. Once power down= =A0the MCU can only be powered up by applying BATT_12V power.

tor is disabled cutting off supply to =A0MCU? How to add little delay (say =

200 ms ) to bring Enable pin Low after the GPIO becomes Low to allow MCU to= shutdown properly?

ot present and GPIO is Low?

I agree skip the divider on the mcu output it's not needed

a time delay isn't needed either, clearing the "keep-power-on" pin should be the last thing the mcu does

to play it really safe I'd make the code something like this;

Clear_pin; Wait(100ms); Do_reset();

normally the power will be disappear at some point during the delay and it'll never get to the do_reset

but in the event that the BATT_12V returns right when you are trying to turn off you hit the do_reset and will not end up in some wierd state where you think you have turned off power but hasn't

-Lasse

Reply to
langwadt

..

ent AND/OR GPIO from MCU is HIGH (3.3V). Disable only when BATT_12V not pre= sent and GPIO is Low (0V).

enables the regulator.

to switch off the power to itself by disabling the regulator. Once power do= wn =A0the MCU can only be powered up by applying BATT_12V power.

lator is disabled cutting off supply to =A0MCU? How to add little delay (sa= y 200 ms ) to bring Enable pin Low after the GPIO becomes Low to allow MCU = to shutdown properly?

not present and GPIO is Low?

That is not reliable unless the processor maintains operation down to 1.2V,= the smallest voltage the LM22672 can sense as a valid EN.

Reply to
bloggs.fredbloggs.fred

e...

esent AND/OR GPIO from MCU is HIGH (3.3V). Disable only when BATT_12V not p= resent and GPIO is Low (0V).

V enables the regulator.

w to switch off the power to itself by disabling the regulator. Once power = down =A0the MCU can only be powered up by applying BATT_12V power.

gulator is disabled cutting off supply to =A0MCU? How to add little delay (= say 200 ms ) to bring Enable pin Low after the GPIO becomes Low to allow MC= U to shutdown properly?

2V not present and GPIO is Low?
y

V, the smallest voltage the LM22672 can sense as a valid EN.

how could that possible happen? EN is either BATT_12V divided, or

3.3V mcu keeping power on, or ~0 (47K pull down, mcu pin low) once the EN goes low the voltage will drop, and there better be a reset ic or internal brown out detector reseting the mcu when it gets below safe operating voltage otherwise there won't be any safe way of turning it off

-Lasse

Reply to
langwadt

VAe...

present AND/OR GPIO from MCU is HIGH (3.3V). Disable only when BATT_12V not= present and GPIO is Low (0V).

.6V enables the regulator.

Low to switch off the power to itself by disabling the regulator. Once powe= r down =A0the MCU can only be powered up by applying BATT_12V power.

regulator is disabled cutting off supply to =A0MCU? How to add little delay= (say 200 ms ) to bring Enable pin Low after the GPIO becomes Low to allow = MCU to shutdown properly?

_12V not present and GPIO is Low?

e

nly

e

.2V, the smallest voltage the LM22672 can sense as a valid EN.

Well that's how glitches happen, people disregarding the possibilty because= they cannot conceive how they occur. Unless the processor is characterized= down to 1.2V, a software solution is moot. You can also prevent the BATT_1=

2V from interrupting an orderly reset with a diode AND that blanks it out d= uring the 200ms reset pulse:

Please view in a fixed-width font such as Courier.

. . . 3.3V . | . | . [100K] . | . 12V Battery >-[150K]---------. +---. . | | | . | |/ | . .-| | BATT_12V . | =3D=3D=3D [10K] | | . | 100p| | | | . | | | | | . | --- --- --- | . | | . | | __ . | __ '---| \ . GPIO --+----+----------| \ | o ----EN . | | | | o---------------|__/ . [100K] | +----|__/ . | | | . --- | | . | | 200ms . | | --- ---- . | | | | . | | ONE SHOT | | . | | -------- . -- | '---------------+--------------. . | | | | . | | | __ | . --- | '--| \ | . | 100p | o---. | . '------------||--+-------|__/ | | . | =3D=3D=3D | . .--|

Reply to
bloggs.fredbloggs.fred

FRVAe...

s present AND/OR GPIO from MCU is HIGH (3.3V). Disable only when BATT_12V n= ot present and GPIO is Low (0V).

1.6V enables the regulator.

n Low to switch off the power to itself by disabling the regulator. Once po= wer down =A0the MCU can only be powered up by applying BATT_12V power.

d regulator is disabled cutting off supply to =A0MCU? How to add little del= ay (say 200 ms ) to bring Enable pin Low after the GPIO becomes Low to allo= w MCU to shutdown properly?

TT_12V not present and GPIO is Low?

the

only

the

to

en

g
1.2V, the smallest voltage the LM22672 can sense as a valid EN.

se they >cannot conceive how they occur. Unless the processor is characteri= zed down to >1.2V, a software solution is moot. You can also prevent the BA= TT_12V from >interrupting an orderly reset with a diode AND that blanks it = out during the >200ms reset pulse:

when the regulator is on the supply is 3.3V so the EN is 3.3V (-diode) as long as the GPIO is high, if the GPIO is low/undriven EN will be pulled down no matter what the supply is

only time the supply with go through 1.2V is after the GPIO is low, no amount of logic will change that

-Lasse

Reply to
langwadt

ymFRVAe...

is present AND/OR GPIO from MCU is HIGH (3.3V). Disable only when BATT_12V= not present and GPIO is Low (0V).

urn Low to switch off the power to itself by disabling the regulator. Once = power down =A0the MCU can only be powered up by applying BATT_12V power.

and regulator is disabled cutting off supply to =A0MCU? How to add little d= elay (say 200 ms ) to bring Enable pin Low after the GPIO becomes Low to al= low MCU to shutdown properly?

BATT_12V not present and GPIO is Low?

..

t the

to only

g the

t to

then

n

ay

ing

d

to 1.2V, the smallest voltage the LM22672 can sense as a valid EN.

y

ause they >cannot conceive how they occur. Unless the processor is characte= rized down to >1.2V, a software solution is moot. You can also prevent the = BATT_12V from >interrupting an orderly reset with a diode AND that blanks i= t out during the >200ms reset pulse:

If it was that simple, people would never have problems with self turn off = logic, but they do.

Reply to
bloggs.fredbloggs.fred

AND/OR GPIO from MCU is HIGH (3.3V). Disable only when BATT_12V not present= and GPIO is Low (0V).=20

les the regulator.

tch off the power to itself by disabling the regulator. Once power down th= e MCU can only be powered up by applying BATT_12V power.=20

r is disabled cutting off supply to MCU? How to add little delay (say 200 = ms ) to bring Enable pin Low after the GPIO becomes Low to allow MCU to shu= tdown properly?

present and GPIO is Low?

If by "battery is present" you mean it is possibly manually disconnected/co= nnected into the system, then you probably need to think about debouncing t= he presence detector too. That can be done with a simple RC, another advant= age to having Schmitt trigger gates: Please view in a fixed-width font such as Courier.

. . CONVERSION TO NAND LOGIC 74HC132 . . . . 3.3V . 12V Battery >-[82K]-+-[82k]-. | . +| | | . =3D=3D=3D | [100K] . 10u| | | . --- | +---. . | | | . | |/ | . .-| | BATT_12V . | =3D=3D=3D [10K] | | . | 100p| | | | . | | | | | . | --- --- --- | . | | . | | __ . | __ '---| \ . GPIO --+----+----------| \ | o ----EN . | | | | o---------------|__/ . [100K] | +----|__/ . | | | . --- | | . | | 200ms . | | --- ---- . | | | | . | | ONE SHOT | | . | | -------- . -- | '---------------+--------------. . | | | | . | | | __ | . --- | '--| \ | . | 100p | o---. | . '------------||--+-------|__/ | | . | =3D=3D=3D | . .--|

Reply to
bloggs.fredbloggs.fred

kZymFRVAe...

V) is present AND/OR GPIO from MCU is HIGH (3.3V). Disable only when BATT_1=

2V not present and GPIO is Low (0V).

or > 1.6V enables the regulator.

turn Low to switch off the power to itself by disabling the regulator. Onc= e power down =A0the MCU can only be powered up by applying BATT_12V power.

w and regulator is disabled cutting off supply to =A0MCU? How to add little= delay (say 200 ms ) to bring Enable pin Low after the GPIO becomes Low to = allow MCU to shutdown properly?

n BATT_12V not present and GPIO is Low?

6...

out the

n to only

ing the

ant to

, then

pin

elay

rying

erd

n to 1.2V, the smallest voltage the LM22672 can sense as a valid EN.

r

any

ecause they >cannot conceive how they occur. Unless the processor is charac= terized down to >1.2V, a software solution is moot. You can also prevent th= e BATT_12V from >interrupting an orderly reset with a diode AND that blanks= it out during the >200ms reset pulse:

f logic, but they do.

maybe but this scenario isn't complicated, either gpio is high and power is on, or the gpio is low and it no different than removing the supply from any other board. The 3.3 will drop as the bypass discharge and a reset ic or brown out circuit in the MCU will reset it

Adding a delay is just waste because the mcu can't do anything during that delay other than wait for the power to disappear

This is how most car ECU are powered, ~12V constant power from battery, power on signal 12V from ignition

-Lasse

Reply to
langwadt

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.