A couple things: If you set the WDT up with a relatively large prescale value it will only wake every second or so. You should be able to go back to sleep in just a few instructions. I would classify this as a 'micro-sniff' of power. Remember, the WDT timeout interval isn't very accurate. If your 90 seconds has to be pretty close you might have a problem here. One thing you could do is 'calibrate' the WDT as follows: Start a loop that does nothing but run up a counter. Do _not_ CLRWDT in this loop. When the WDT reset occurs take a look at the counter value. This will give you a pretty good idea of the WDT interval. Of course variations in Vcc, temperature and the phase of the moon will affect the WDT interval. Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) ----- Original Message ----- From: Jinx To: Sent: Wednesday, August 30, 2000 10:47 PM Subject: [PIC]:Timeout > Could I have some advice please on a bunny question. I've used > WDT in some apps but this is quite different to what I've required > before > > I've a program on a battery-powered F84 unit, so consumption is > critical. > > There are two main sections of code - one uploads data, the other > downloads on a PB0 IRQ. I have to put a timeout of 90 seconds > between PB0 IRQs, ie after the last byte has been sent, PB0 must > be ignored for 90 seconds. Uploading occurs in normal-power mode > and then the unit goes to sleep. PB0 is used as a wake-up. WDT > would seem to be the best low-power method, but WDT should > desirably be active for only the 90 seconds to increment a counter that > can be looked at to reject PB0 IRQs. Once say 40 * 2 seconds WDT > wake-ups have occured then PB0 IRQs will be recognised again > > Is there any way/trick to stop WDT wake-ups during the vast majority > of the time that they aren't needed or is it all or nothing ? During > uploading I can sprinkle a few CLRWDTs around to stop it interfering. > IIRC from a previous job a very short wake-up uses a sniff of extra > power, but I'd prefer a mini-sniff if possible > > Without any external i/p, any suggestions for an alternative to WDT > that uses less power or is this as good as I think it gets ? > > TIA > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > "[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's -- http://www.piclist.com hint: PICList Posts must start with ONE topic: "[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's