Quote Originally Posted by sougata View Post
Hi,

Is your PORTA.5 changing all the time. Please note that the latch that holds the value for a mismatch is not cleared upon MCLR reset. Thus depending on your code there may be a condition where your PIC resets and you don't realize. (If you are manually polling values)

Please post your complete code and schematic.
Okay, I will draw the schematics today.
The code is huge (I fill all the 2048 words program space!!).

PortA does not change all the time. It is set as output and set to LOW, there is no reason why it should change.
When an interrupt occurs, the int handler takes care of reading porta to refresh the latch so there should be no mismatch.