On 11/01/2018 20:57,
ted...@gmail.com wrote:
> Hi and thanks for responding.
>
> I have a touch sensor. Goes on when touched and off when not. I
> want my uC to do a service operation at each edge of that (possibly
> long) 'pulse'. My uC needs about a second or so from power up to the
> beginning of program start. The uC is energized by that sensor
> signal being ON. At program start it immediately asserts another bit
> that controls whether to continue power to itself and other circuits.
> So the one-shot duration is just long enough to wake up the uC, which
> then services the event and then goes back to sleep.
Doesn't the CPU support a hibernate mode with wake on change for certain
pins? Even if it was only for one edge transition then a pair of those
pins and a single inverter would get you what you want.
The sleep and hibernate modes are worth studying (as is figuring out the
minimum clock rate you can operate at and still be just fast enough).
32kHz watch crystals are cheap and plenty fast enough for a user
interface or slowish mechanical event timing. Rough and ready RC clock
timing is even cheaper and you can have a turbo mode if you need one by
having the CPU alter the resistor if it needs a burst of speed.
It seems a bit brute force and crude to start up from cold every time.
> I plan to use a four cell (or possibly six) penlight pack for power.
> I'm hoping to tolerate battery decay to just above 3.3 volts from a
> max of about 6 or 9.
The batteries will leak and destroy their battery compartment if you
push them that far. Duracells these days seem particularly prone to
leaking if used in low voltage tolerant low current drain LCD devices.
I notice in passing that Everyready are advertising their latest
alkaline offering as "leak free" - that *is* a brave claim.
>
> So the one-shots are about a second or so in duration and the spacing
> between the sensor signal edges is typically several seconds. Most
> one-shots I've found assume a trigger pulse much shorter than the
> one-shot itself and I need the reverse. An input that initiates an
> identical pulse at either edge would be ideal.
>
> Price is a consideration - a cheap timer and few external components
> is a plus.
>
> I want to implement a sleep mode whose quiescent current only powers
> the touch sensor (at ~ 5nA) to maximize battery life with all else
> being off.
It probably isn't worth getting average quiescent current much below the
self discharge rate of typical alkaline batteries (ie <5uA). If you were
running it off a tiny battery then it might be worth trying harder.
I find on very low current draw devices <10uA the battery life is more
dependent on the ambient temperature than the load.
--
Regards,
Martin Brown