I need to design a power circuit for my microcontroller such that:
1- It works (connects controller to vdd) when a push button is clicked
2- microcontroller stays on until it receives an input signal (let's say it's input1)
3- Once controller receives this signal it sends a control signal (output1) to the power circuit to turn it off (turn itself off)
let say , connect p channel mosfet parallel to button, another bjt with collector to its gate , emitter to groun and base to mcu port . When button pressed , mcu energized, configures port sends 1 to bjt and shorts button . When your signal received mcu outputs 0 to bjt and mosfet is closed .
u can use MIC2506 for this application.
Go thru its datasheet.
for ur instant refernce:
it has got-
CtrlA
CtrlB
OutA
OutB
Input
short OutA and OutB and give to the controller
Connect the switch at CtrlA
Connect the controller signal at CtrlB
Give Vdd at Input
theory:When u press the switch CtrlA activates and trnsfers the i/p to the output.As both your o/ps are tied together and given to controller,it turns on,and then it gives an ON signal to CtrlB which then activates the Vdd transfer from i/p to o/p until u remove the signal at CtrlB
understood...if no,ask me....if yes,pls go thru the datasheet and verify whether it can be done.b'coz i just understood the IC function and said.
i suggested that chip,if going to implement it in a proffesional way or for mass productions.
For R&D or prototyping u can go discrete.May be u can make your own discrete ckt of that Chip or artems idea,thats a good 1.
artem:
You have a good solution but there is one problem : how can you make sure that your pushbotton will be on enough time so that uc can be initialize the port ? I will not mention the debouncing because RC can solve it but If I applied your design I will have to use monostable after the switch
cameo_2007:
Thanks for the chip, but the input logic inside the chip is not just (OR). I checked it out and they have another version (05) which has one control and may be I can use 2 diodes as wired OR outside but still the same problem arises (how can you make sure that the switch on period will be enough for the controller to initialize the port ?) Monostable is needed ... right?