You always have to clear interrupt flag in software
before retfie instruction. If you don't clear the flag,
instruction retfie will set GIE bit and PIC will be
interrupted again. Logical AND function beetwen
int flag bit and int enabled bit (AND-ed with GIE)
will result in interrupt.




Bookmarks