• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.
 

kchriste

New Member
Forum Supporter
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.
 

Sceadwian

Banned
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.

EE World Online Articles

Loading

 
Top