banh
Advanced Member level 1
Hi IanP,IanP said:Please find below "slightly" modified circuit that ensures that the battery is charged when the +12V supply is present, regardless of the state of the "MCU output" pin (picture1), and "simplified" circuit with NPN (picture2) ..
Regards,
IanP
in your picture 1 (using PNP & NPN), when 12V is off the battery is always supplying to the regulator (via 200Ohm & diode), regardless of the state of the MCU output !
In your circuit in Figure 2 (using only NPN), because the battry negative terminal is conected to Collector, the current is not flowing for Collector to Emitter, but in the reverse direction! Is there any problem with this?
Added after 1 hours 12 minutes:
now i think of another way:
no more battery, and use only 1 12V power source (see attached circuit).
when the main switch is open -> NMI handler will start running and turn on the NPN, which will turn on the PNP. At this time 12V is supplied again, the MCU keeps on running, does necessary backup and finally turn off the NPN to shutdown its own.
Any comment on this circuit?