watchdog, sleep & overflow @ pic16f628a

Status
Not open for further replies.

mabauti

Member
Hi guys:

I have a doubt about the watchdog functionality.

Let's say that I have the watchdog enabled, then during the program I use the instruction sleep and then the instruction nop.

Code:
    (stuff)
   sleep
   nop
   (more stuff)
My question is : where does the program continuw after a watchdog interrupt?

to the nop instruction or to the program address 0000h?
what's the correct way to use the watchdog?

t.i.a.
 
If the PIC is sleeping, due to executing the SLEEP instruction, then the watchdog timeout event will cause the PIC to resume executing with the instruction following the NOP.

If the PIC is just executing normal instructions (not sleeping) then it will be reset and start executing instructions at 0000h.
 
ram is usually retained during resets and sleep modes. Read the PDF for your PIC, it will tell you the startup conditions of every power up mode.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…