Hi Anand,
That sounds about right since the comparator & internal Vref use a bit more power than the A/D, but doing it the other way you're going to miss a lot of sensor pulses while it's NAPing for ~18mS.
If this doesn't have to respond 'immediately' when the pulse comes, you could just setup a loop taking A/D measurements while sleeping, wake, look for a value, return to A/D sampling while sleeipng, but you would have to configure the A/D manually, start the conversion, then immediately @ SLEEP.
Use the A/D interrupt to wake it from sleep when the A/D sample is finished. It would be sleeping the majority of the time until the A/D result register indicated a change in voltage.
That would help get the power consumption down with the 12F675. You could also put it to sleep during your high pulse by setting the WDT prescaler, and using the WDT VS a PAUSE 500. Set the pin high, go to sleep, wake-up, clear the pin, return to wait for the pulse.
I'll 2nd the 12LF1822. This part also allows you to enable/disable WDT, and everything on it uses less power than the 12F675.
Run it on an external 32kHz LP oscillator, and use the comparator for wake-up. On wake-up, enable WDT with a prescaler set to 512mS. Take your output high, goto sleep for the duration of the 500mS pulse. Wake up, clear the output, disable WDT, and return to sleep to wait for the comparator wake-up pulse.
That would save a ton of power for a battery app.
Bookmarks