I have done such a thing for other processors, but not the PIC (yet). In general, all you have to do is time the start bit and use the count as the time delay for sending and receiving bits. It is necessary to carefully craft loops that are symmetric for time determining, sending and receiving. No big deal really. The first byte detected needs to be one with a space after the start bit, so you are restricted in what characters can be used for the rate detection. After that, any character can be received. '*' 02Ah is a popular choice. If you only send the right characters, I suppose you could do speed determination on every byte, but it is more usual to only check on the first character received after a reset or other external indication. You could use the DTR as an indicator. > From: Mauricio Culibrk > In one of my applications, I need a serial RX/TX routine capable to > 'recognize' the speed of the serial line, so it can adjust itself to > that speed (eg. I have a '84 based 'host' to which I want to attach > few 'terminals' working at 1200, 2400, 4800, 9600 baud). > Did anybody try something similar? > Any ideas on how to determine the RX speed, possibly without loosing > a byte of data? > > Thanx, > > Max > -- peterj@netcom.com