Detect Serial Baud Rate

Posted on by

You've got a considerable challenge here! You can't set a baud rate until you've detected the baud rate, and you can't detect the baud rate until you've set it. What I would do is: (This ASSUMES you have a congenial operating system, like DOS or at most Windows-98. Not NT, 2000, or XP.) Jumper the data-in line from the normal (pin 2 or 3) recv input to the UART, to some other input pin (DCD or CTS). Go input a loop watching the DCD or CTS pin. If it goes low, measure the time until it goes high.

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. I'm setting up a console server and I need to determine the correct baud rate of my port. I'd like to do this from the command line, if possible. Does anyone know how? From time to time I suddenly have a need to connect to a device's console via its serial port. The problem is, I never remember what port settings (baud rate, data.

Feb 09, 2012 Hi All, We have a weigh bridge connected to PC via serial port.A VB code fetches the data from serial port and puts it in clipboard,which can be used.

Serial Baud Rate 115200

That's your approximate bit rate. Life Simulation Games From Birth To Death here. Now read in 8 bits assuming that rate-- i.e.wait half the bit time, read the line, repeat 8 times. Anathema Discography. Note the time the line goes high after you've read the 8th bit. The you shoul dget a stop bit (high).

If you don't get a high bit as bit #10, you're either off on your baud rate estimate, or you got a garbaged character. Now divide the elapsed time by 9, it should be a closer estimate of the actual baud rate. Oh, and check the received character, it should be your 0x55. Or more likely you'll get a garbage character or two at startup. Ignore those and wait until you get a reasonable looking character. Repeat as needed to read in the characters.

If you need higher efficiency, once you've figured out the baud rate, you can then program the UART to match that rate, then you can read the rest of the characters thru the normal UART methods, which will free up your CPU for other things. Regards, grg99. Army Man Pdf George Meyer.