Not sure how PBP deal with SLEEP 45, but from memory, the WDT "should" use TMR0 as clock source, and if you don't assign it to, then it may indeed give you some problems... but you're currently using TMR0 for something else, so probably part of the problem.
I would probably opt for a real WDT timeout interrupt with @ SLEEP, or see if there's any other Timer who can wake-up the PIC, leaving TMR0 free to count your pulses.
Check your datasheet to see how each Wake-up source behave.
Last edited by mister_e; - 2nd June 2009 at 18:34.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks