I am interfacing to an Elo touch screen for a custom solution. The elo messages are suppose to always be 10 characters long and start with the character U. I want to be able to capture all 10 characters in an array but only start when the "U" is received. I can do this utilizing a for next loop or even a STR VaraibleName\9 modifier however I have a few issues with these methods.
1 What if the two system turn on out of sync and the PIC18f24K22 starts to receive in the middle of a message?
If my code always expects 10 characters it will then always be out of sync
2 What if for some reason communications are lost, then the loop gets stuck, it needs an exit.

I should add, the communications is asynchronous and using only the TX/RX pins, 9600/8/n/1

I wanted to have
hserin 100, main, [char[0]] 'if there is no message then go back to main program
if char[0] = "U" then 'if there is a message AND it is the beginning of the message, then capture the rest of the message, but at this point, the buffer is full
for i = 1 to 9
hserin 100, exit, [char[i]]
next i

However, when i use this, the buffer fills up before I can collect any other characters. I expected the execution time (I am using the internal oscillator and running at 16 mhz) to be quick enough to grab each character before the buffer filled up. The above method will get the first two characters, then fill up. I then send more characters which are captured. I tried adding an rcsta.4 reset as follows, however that didn't solve any of my problems.

hserin 100, main, [char[0]]
rcsta.4 = 0
rcsta.4 = 1
if char[0] = "U" then
for i = 1 to 9
hserin 100, exit, [char[i]]
next i

I would appreciate any suggestions on an approach which will allow me to get in sync with the elo and handle the rather small buffer.

Thanks
George