>From Walter's first msg: > It sounds strange to me. Sorry :) It was in response to a suggestion to not use the WDT; I was explaining that I'd have to use it in order to time things. Without it I'd have to stay awake running at full power the whole time the tilt switch was closed. Knwo what I mean? > If you are connecting the tilt switch to trigger power on to the unit, > and if this is the only function of the switch, probably you will have > just a pair of wires coming out of the switch, right? like a > mercury or > steel ball switch. In this case, if the switch fails by any > reason, it > will not power up your circuit, and *NOT EVEN* tells your circuit that > the switch is tilted when you wake your circuit periodically to check > the switch... it means that doesn't make sense to wake up your circuit > periodically to check the switch, because if the switch is failling, > your circuit would not be able to check it. I always do such a terrible job of explaining things! Here's the deal: say you are a PIC, trying to last as long as possible. You are off until powered up by (through) a tilt switch. Then you latch yourself on and begin timing the tilt. Which means you have _to monitor_ the state of the switch, because it no longer controls your power, right? Then, when the tilt switch finally goes off you send you total time logged to somewhere else. Once done communicating and making your own internal records, you unlatch yourself. See? > A very simple and economic way to do that... just use the > switch to feed > the base of a transistor via a high value resistor. Upon the switch is > tilted, the transistor powers the PIC, the RESET condition at > one of the > PIC I/O port pins keeps the transistor operating (via a > smaller resistor > that bypasses the tilt switch resistor). At this time, the tilt switch > can even return to normal, the PIC will still keeping the transistor > feeding power to it. At the end of your software routine, just change > the voltage of that port I/O pin and the transistor opens *forever* > waiting again the tilt switch. This is the kind of thing I was wondering about. Do you mean RESET condition (IO pins hi Z state), or an active driving of the pin by the program once the PIC starts up? So the NPN is on the ground side of the PIC. But in this case, how can the PIC turn itself off, since it's ground is higher than the emitter? Oh, yeah, it's current not voltage, so it just goes high impedance. And from Walter's other msg: >The following circuit variant doesn't need the PIC port pin to be driven >high at the reset, but it needs a LOW level to power off the circuit via >the diode. In some way this version is better than the above since it >latches itself immediatelly, without even the need of the pic to keep it >latched. I like it, but I had the same question Dennis had about the big cap. And he raises another interesting question; I hadn't thought about a brownout condition on power down which causes unknown output states. Would this really happen? Wouldn't the transistor shut down pretty quickly? Maybe I'm not conceptualizing that scenario too well. And maybe he's right too that I should just do a simple always-on device. Thanks, Bruce Cannon Style Management Systems 1228 Ceres ST Crockett CA 94525 (510) 787-6870 http://www.jps.net/bcannon Remember: electronics is changing your world...for good!