If you're using the Assembler @ SLEEP, the WDT needs to be Disabled (OFF).
If you're using the Assembler @ SLEEP, the WDT needs to be Disabled (OFF).
Hi Melanie,
I agree that the Watch Dog needs to be disabled. I used this line which I thought should do it:
@CONFIG.2 = 0 ' 0=Watch Dog Off
Also tried this too
@ CONFIG.2 = 0 ' 0=Watch Dog Off
Maybe the order or location which I have the line is not correct? Or if I try disabling the watch dog using either of these two lines instead of @CONFIG.2=0, I get an 'Illegal Opcode (WDT_OFF)' error from MPASM.
@DEVICE WDT_OFF => Illegal Opcode (WDT_OFF)
@ DEVICE WDT_OFF => Illegal Opcode (WDT_OFF)
WDT is usually controlled from the Config Fuse definitions...
http://www.picbasic.co.uk/forum/showthread.php?t=543
Although Microchip have recently started tinkering with the CONFIG statement, so look in MPLABS HELP file for the latest syntax. Whn I've time I'll update that thread... or perhaps someone else might want to tag the latest MPASM amendments onto it...
In the datasheet it says "If the device is in Sleep mode, a WDT time out causes the device to wake up and continue with normal operation."
The next line says "The Watch Dog can be permanently disabled by programming the configuration bit WDTE as clear." That is just what I have in my code (CONFIG.2 = 0) yet the PIC is still resetting itself.
Have you checked that when you burn your PIC, the WDT is set to OFF in your programming software?
This is why I love the forum. That was the problem! Just incase anyone is using ICPROG and encounters this same problem, you have to uncheck the WDT check box. Thank you Melanie!
Bookmarks