well... your first code was right
but i noticed the INTCON change between your 2 version, then i looked into the datasheet to confirm it could be the problem.. seems yes.
Out of curiosity, which version of the compiler are you using? The Watch-Dog reset sounds weird to me as the compiler should handle it for you... unless you ask to not doing it with a DEFINE.
I could also bet on a hardware problem... but i don't see any schematic... bah... since it's working now![]()
Bookmarks