Hello all, > Alice Campbell wrote: > > > > hello all, > > yes, im STILL trying to figure out watchdog timeouts and sleep. > > can anyone tell me: > > does _mclr and/or watchdog timeout clear the stack? they both seem to > > return to the origin (reset pointer). no, but it resets the tris and option registers to ones. > > If a deliberate timeout loop triggers the dog, how can i find out > > whether a call to a timing loop has lost its return, and clear the > > return if needed? you cant unless you reinitialize the ports > > > > if the watchdog reset and mclr reset clear the stack, why does the > > pic (16c84) lock up on the first subroutine it encounters? because you didnt reinitialize theports > > > > and finally, why wont it wake up from sleep? i cant shout at it, the > > rest of the family's asleep. because you didint reinitialize the ports > > > > the timeout loop is to time the wdt period. ive looked > > at appnote tb004 but there seems to be a mistake in it.... they test > > status for the sequence b'10100101', but the wdt sequence is > > b'10110101', the one they use wont tell sleep from wdt. it is more subltle than even that. if wdt is set on _mclr, then it will think its powerup reset. you have to set a flag on powerup and read that to distinguish a true powerup from a _mclr or clrwdt trigger. > > > > and im nearly 46. built timex z-80 from a kit. also a ham (ka7dyq) and can hardly wait to finish the project that ate my brain and go back to knitting. > alice, 46, ka7dyq aka 'mom' de los angeles hydrogeology & hydrogeochemistry, groundwater modeling, data analysis, knitting, spinning, homemade marmalade, chutney, beer, & horehound cough-drops, plein-air paintings (any planet), woodcuts, new at microp rocessors 'what century IS this, anyway?'