This can cause a lot of headaches sometimes due to read-modify-write;
HIGH PORTE.1 ' reads whole port, flips this bit, writes whole port
LOW PORTE.0 ' same, but if RE1 isn't high yet, RE1 is read & writen back as 0
Try just toggling the LED on RE1 to verify that you're entering the interrupt routine.
Another potential show-stopper is directing RESUME to Done, which halts everything.
Try something like this;
Code:INITIALIZE: ' Initialize Routine IOCB = %00000001 ' Enable interrupt-on-change on RB0 INTCON = %10001000 ' Global & interrupt-on-change on Port b enabled '************************************************* On Interrupt goto Halt ' on interrupt go to the Halt routine MAIN: HIGH PORTE.0 PAUSE 500 LOW PORTE.0 PAUSE 500 GOTO MAIN '************************************************* DISABLE ' do NOT place interrupt checking code below Halt: ' Halt Routine WHILE PORTB.0=0 ' wait for button release & end mismatch condition on portb WEND TOGGLE PORTE.1 INTCON.0 = 0 ' Clear the interrupt-on-change flag RESUME ' Go to Main routine ENABLE ' Enable all active interrupts




Bookmarks