> > I know you can do it by using the watchdog oscillator, but this
> > newbie has absolutely no idea how to do it
>
> You'd need something like this, assuming a ~2.3 second WDT,
> ie maximum (128) pre-scaler
>
> movlw 0xf9 ;count up to 00 (7 WDT wake-ups)
> movwf count
>
> zzzz sleep ;power down
> incfsz count ;increment count on WDT wake-up
> goto zzzz ;not done, back to sleep
>
> more code ;resumes here after 16.1 seconds
>
> Don't forget to enable the WDT in CONFIG. If you use the pre-
> scaler, assign it to WDT in OPTION. The WDT has a nominal
> period of 18ms, and you could get closer to 16 seconds by
> using a pre-scaler of 8 and a 111 count (16000/18=888, 8*
> 111*0.018 = 15.984s), but this does use fractionally more
> power because of the greater number of wake-ups and WDT
> is temperature-sensitive anyway
>
> Note that the instruction after the SLEEP is pre-loaded at the
> time the SLEEP is executed, and has immediate priority on
> wake-up, ahead of any IRQs. If you have a wake-up source (eg
> pin interrupt) that you wish to be the program flow controller you
> should put an NOP after the SLEEP. This will cause the interrrupt
> jump to be performed on wake-up
>
> --
>
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
> email
RemoveMElistservKILLspam
mitvma.mit.edu with SET PICList DIGEST in the body
>