Information on INTCON will be found in the PIC data sheet. Not your PBP manual.
Do NOT GOSUB to another routine outside the DISABLE / ENABLE block in your interrupt handler.
After the ENABLE, PBP begins placing more code to jump to the interrupt check routine. So what happens is you jump out to BLINK, you land smack on code that sees the interrupt has not been serviced, and bingo, you're sent right back to SerialDataReceived before code in the BLINK routine can execute.
Keep all code in your interrupt handler in the protected area between the DISABLE/ENABLE block, or simply remove ENABLE. If SerialDataReceived and BLINK are the last routines in program memory, then you don't even need the ENABLE. This tells PBP to start inserting code before & after each PBP statement to test for the interrupt condition.
Try this;
Code:
DISABLE
SerialDataReceived: ' Buffer the character received
HSerin [DATARECEIVED] ' Read USART and store character to next empty location
IF RCIF Then SerialDataReceived
HIGH LEDPIN
PAUSE 1000
LOW LEDPIN
PAUSE 1000
RESUME
END
Bookmarks