Just curious, can you simplify the circuit using a regulator that has an on/off switch ? For example http://cache.national.com/ds/LM/LM9074.pdf or http://rocky.digikey.com/WebLib/Sharp/Web%20Data/pq1txx1m2zp.pdf Tal > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Russell McMahon > Sent: Friday, September 12, 2003 8:33 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: [PIC:] Auto shut off > > > Auto poweron/poweroff is a perennial. > Here's a post message I posted in April based on something > posted in .... This is based on a circuit I have in > successful use in a low volume production specialist item. I > could give you (Jinx) a PCB to populate to try it if you wished. > > This draws NO measurable current when off, starts on a button > press and subsequently allows the button to be used as an input. > > > Russell McMahon > > ________________________________________ > > > I'd like to > > 1) Turn on the device by pressing a button > > 2) Later be able to have the PIC turn itself off > > 3) While the PIC is on, have it be able to detect "ON" > button presses > > again > > 4) Only use one IO pin (so gnd or +5v to switch off, high-impedance > > input to detect button and stay on) > > Here's an attempt to meet your full specification. > I haven't tried it and it's not fully designed yet but I > think a little thought and/or playing would make a reliable > working circuit from it. > > There are too many requirements on the single pin to allow a > simple digital 0/1 full rail signal level to be used. Roman > Black recognises this in his SCR design and "cheats" by > making the turnoff function independent of the pin - in his > cct the PIC reduces its current consumption below the SCR > hold on current. This is a clever and legitimate solution but > will not work in cases where there is other circuitry drawing > current in excess of the SCR holding current. > > My solution also uses a "trick" - but using the PIC pin to do > it. Transistor TR2 is held on by R3+R4 BUT the voltage at the > junction of R3 & R4 is a LOGICAL low level which the PIC can > read. When the button is operated after startup the PIC pin > sees a logical high. > > To turn the circuit off the PIC (or other cpu) takes R3/R4 > junction to ground. Proper design may wish to see a small > series resistor to avoid possible damage from the 100uF > capacitor discharging into the pin. The true low level turns > off TR2 and initiates shutdown. Somewhere along the way the > PIC will lose the ability to maintain an active low output > and C1/R3 must have a long enough time constant to hold the > transistor off after this. > > The time that the voltage into the regulator (on capacitor > C7) stays actively high will be an important factor in turn > off. Suitable care and thought would definitely turn up a > working combination but odds are that as shown the component > values are wrong. > > If the regulator has a substantial output capacitor but a > smaller input cap, the PIC may be designed to stay alive > after TR3 is turned off. This would ensure the circuit is > well shut down before the PIC expires. > > PIC "death throes" need to be carefully thought through - as > is always the case in this sort of circuit. > > Z1 stops PIC pin being taken illegally high. > R5 provides turn off for TR2 in absence of other drive > sources. R3/R4 divider, which holds TR2 latched on, must > provide low enough output to place a logical 0 on PIC pin, > while R7/R4 divider provides a logical high. R7 sized to > provide enough level for a logical 1 - higher voltages will > be clamped by Z1. D3 left over from a prior circuit - does no > harm but Z1 probably sufficeth at 4v7. C1 value should be as > low as reasonably possible consistent with turn off timing > requirements. R4 can be made much larger (depending on > transistor beta, load current supported etc) - allowing > scaling up of other resistors allowing smaller C1 > > > > Russell McMahon > > > > > > > -------------------------------------------------------------- > -------------- > ---- > > > > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply > us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body