When I've done this I send a series of characters "I think I used "J" for some reason. the receiver then only has to adjust its RX bit pattern to find the "J" and respond that it has acquired sync. (or just wait for start of data) You can get real clever and send a string which decodes to reveal the bit offset you're receiving but I didn't have any trouble with the simple approach. Richard > -----Original Message----- > From: Quentin [mailto:qsc@ICON.CO.ZA] > Sent: Wednesday, September 15, 1999 2:49 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: RS232 revisited > > > Picsters > I've read the past posts on RS232 in the last couple of weeks. Steve > Thackery's email (Start and stop bits) and Comlite32 have cleared up a > lot of mysteries about RS232 (Finally decided to try and master it). > Also some examples on the Net helped. > > Here come the Q's though: > My PIC is going to read 3 bytes of data which is looped out of the PC > with a 105 millisecs (according to Comlite32 and I am not even sure if > it is millisecs) delay between the 3 bytes. The first byte is > just a set > ASCII character to tell the PIC the next two bytes are data. The PIC > then uses this data and return to read the serial line again. > As the PIC can start checking at anytime in the data stream, I would > like to know if anybody know a good way to synchronize with the data > stream? > > I don't like the idea of checking for a long delay, so > obviously I must > check for the first byte (ASCII character). To do that, I must first > find the start bit and then check if the byte is the ASCII. Any good > ideas on how to do that? > > I can not modify the data stream or talk back to the PC. > > Maybe I am missing the obvious here so any help will be appreciated. > > Quentin >