Auto detect Baud Rate
Posted on 1997-09-27
I am looking for source code in C and/or assembly for PC under DOS, to automatically detect and set Serial-Communication parameters such as: BaudRate, Parity, DataBits and StopBits.
The idea is to connect any kind of equipment to the COM1: serial port of a PC and automatically detect these parameters whenever the equipment transmmits some bytes over the serial link.
Theoretically, it is possible to try and set the COM1 parameters to every possible combinations of (baudrate, parity,databits and stopbits) until no errors are detected!
I never tried this thoroughly because I never managed to automatically detect any error at all.
Any suggestions are welcome. An executable program would also be interesting (but not for 400 points)!
I suppose the DEC terminals VT220 can tackle this problem,
at least for baudrate...
Thanks in advance,