I need to be ready to accept RS-232 input at any time in a PIC18F8722. It normally sits in a tight loop, so I monitor the PIR1.5 bit. When it is set, I jump to my input routine using HSERIN. However, my program must occasionally send out long strings using the HSEROUT command. I must have a way to immediately break out of my SEND routines if a character is received.
I was hoping to be able to usint the ON INTERRUPT statement to help me. My questions are - when sending a long string of characters, does the ON INTERRUPT statement add the check for the interrupt flag bit between each character sent, or does it wait until the entire string has been sent?
Would the SEROUT2 command work any differently?
And normally, I would use the ON INTERRUPT structures to send the program off to a special interrupt handler and put a RESUME at the end of that handler, but I don't want to use a handler. Upon receiving a character, I want to jump to my normal input routine and process the input in the normal way.
(I don't need to pick up right where I left off in the SEND sequence). In such a case, where would I put a RESUME statement? And if the program comes across a RESUME in its normal flow, will something blow up?
I can't use the ON INTERRUPT for all input routines because of the overhead involved.
Bookmarks