RBIF: RB Port Change Interrupt Flag bit
A mismatch condition will continue to set flag bit RBIF. Reading PORTB will end the mismatch condition and allow flag bit RBIF to be cleared.
With your LED on PORTB.1, that's exactly what you're doing with LOW LED. With your LED on PORTE, you're not performing a read-modify-write on RB, and the missmatch condition still exists.
Just read PORTB in your interrupt routine, then clear RBIF, then return. Assuming you have your PORTE A/D turned off, it should work fine.
The value read from PORTB in the interrupt handler will now be the new value that causes the interrupt once changed.
Bookmarks