(Not directly related to the F628A, but anyway...) What Byron describes below, is more or less what's built in in those PIC with the "Enhanced USART". Those have something called "ABD" or "Auto Baud Rate Detect". The "other side" must send a "U" (h'55') which is used to calculate the correct value for the BRG register. Another nice feature of these PICs are that the Baud Rate Register is 16 bits (instead of 8 bits), so you can get very low baud rate errors at a wide range of combinations of Fosc and baud rate. Regards, Jan-Erik. Byron A Jeff wrote : > It would be even better if you could build a protocol around > the concept. > Caller ID uses the concept by sending a string of U's as a > header for the CID packet. U's ASCII code is 55 hex which > means the bit pattern on the line including the start and stop > bits is 0101010101 which is easy to pick out the width of a > bit cell. So if I had control over the protocol this is what I'd > do: > > 1) Have the host controller send U's as a resync packet. This > will give the > 628 a chance to get it's clock right. These can be bit banged > received and > then the BRG adjusted to match the incoming clock to the > current oscillator. > > 2) Then fire up the hardware USART and start communicating, > keeping track of > both the frame error and packet checksums. As long as no > errors occur, keep > ACKing incoming packets. > > 3) When a error occurs, then NAK the packet, which forces the > sending of a > resync packet, going back to step 1. > > This could track drift in some pretty poor conditions I think. > > BAJ -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics