Interupts and sleep and aneometers

I have code from Sparkfun Weather Station | Kevin Kessler's Projects

The anemometer triggers an interrupt, and the "speed" relies on a time (the code is using millis()).

two questions:

  1. when put into sleep mode - it turns off timer0 which drives millis() for almost all of the modes - and there goes the millis() counter. - the only one that can be left on in some modes is timer1 - I guess I am looking for a way to keep some timer to calculate wind speed and still sleep.

  2. In the case its put to sleep and the anemometer triggers an interrupt. Seems to me that it would wake up the chip and need to be put back to sleep. This is where i can not wrap my head around some way to keep an accurate time in the face of random interrupts and sleep mode.

My battery is rated at 2000mah and at the measured 40ma it will only last for 50hrs I was hoping for orders of magnitude more than this.

The best Idea I have had so far is to turn off the anemometer interrupt - go to sleep - wake up - turn on the anemometer interrupts and take some time and measure the current wind speed/gusts - however this this just seems so inelegant.

sydkahn:
The best Idea I have had so far is to turn off the anemometer interrupt - go to sleep - wake up - turn on the anemometer interrupts and take some time and measure the current wind speed/gusts - however this this just seems so inelegant.

How is that inelegant? - surely its obvious you have to disable them to be able to sleep
properly. In many circuits you have to power-down peripherals explicitly before sleeping
and power them up again on waking, its entirely reasonable.

You'd normally have two functions one before sleeping, one for after waking up, package
all the power management into these.

Because anemometers and rain gagues - close counts...

It occurred to me that i could just use the sleep as the time reference. In the two interrupt routines bump their counters and put the chip back to sleep. All i would need is how long the current sleep period was. Hope i can glean that from the watchdog counter register.