Simple way is to use a relay and a small fet. A momemtary on 'Power button' and the fet are wired in parallel to the gnd. Thother side of the fet and power button go to one side of the relay coil and the other side of the coil to the power input. The relay itself connects the input power to your boards power supply input.
Closing the power button closes the relay powering up the board. One of the first things the CPU does on power up is turn the FET on so that the power stays on when the power button is released.
If you use a multiple pole button for your power switch one pole can be used to sense when the button has been pushed and the CPU can turn itself off by turning off the relay.
Proper coil suppression etc is left as an excercise for the reader.
Robert
--
Posted via a free Usenet account from http://www.teranews.com
Connect pushbutton to a latching circuit, as well as too your micro. Turn on latches, when power is on, and button is pressed, micro detects button press and unlatches the circuit. Should be plenty of examples on google, yell out if you cant find one.
That doesn't make too much sense. The functionality you describe *is*, for all practical purposes, a toggle button. You've essentially just told us that the device you're designing isn't allowed to work.
No, he is saying that his requirement doesn't allow a physical toggle switch although the functionality may need to be that of a toggle switch. This may be for safety or aesthetic reasons and seems fine to me.
Have you ever seen a car with a push engine start and stop, whilst not necessarily the same functionality as this, the principal of aesthetics and safety still applies, How naff would it be to have a toggle switch for this function, not to mention the risk of accidentally turning the car off!!
I've put the following circuit in several designs where they wanted a push-on/push-off switch. On battery powered equipment I normally use a CMOS hex inverter with a wide Vcc spec. I won't attempt ASCII art, but the basic netlist is pretty simple.
Tie the output of inverter #1 to the input of inverter #2. The output of inverter #2 is tied back to the input of inverter #1 giving positive feedback.
Output of inverter #2 is also tied to the inputs of one or more of the other inverters. Their outputs drive a p-channel fet that switches the battery on and off to the rest of the circuit.
Tie a 10k to 100k resistor to the output of #1 and the input of #2. The bottom of the resistor goes to a 0.01 to 0.1 uF cap tied to ground. The values aren't very critical. Tie the push button switch between top of the cap and the input to invert #1.
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.