1

I have a device which is continuously sending data through UART.

I'm trying to read it using a terminal application on Windows-based PC. The problem is that I don't know at which baud rate the device is sending the data. The data I'm getting at higher baud rates doesn't make any sense so I have narrowed it down to lesser than or equal to 600 among the standard baud rates available on terminal.

Is there any software to detect the baud rate or a method using any microcontroller??

Vishal B U
  • 17
  • 1
  • 1
  • 5
  • 1
    using any microcontroller probably not. if the pin is shared by a gpio you can poll/interrupt on state changes and measure, the smallest measurement should give you the baud rate. Alternatively you can just scan frequencies, if you get a hit it may still be wrong, could be 2x, 3x, 4x, etc too slow. can get difficult to impossible, to correctly line up just by adjusting your baud, you also need to have a data pattern (frame format, etc) that you can look for when your framing errors go away. – old_timer Jun 15 '17 at 13:30
  • if you are talking about a specific program/device, just put it on a scope, or use your microcontroller to measure the pulses using a gpio and a timer, then from there figure out the baud. – old_timer Jun 15 '17 at 13:30
  • You also might have a mismatch of not only baud rate, but also number of data bits, parity, or stop bits. – D Krueger Jun 15 '17 at 17:07
  • Having established the baud rate with an oscilloscope, you only have to try out the various format combinations. Typically there might be 7 or 8 data bits, a parity bit or no parity bit, and 1 or 2 stop bits. So there are 8 configurations to test with your terminal (emulator). – Weather Vane Jun 17 '17 at 19:47

3 Answers3

3

No, not if you want to get done quickly. Ten years doing this type of task says an oscilloscope or even an inexpensive USB-based logic analyzer is your best solution here. This isn't a software problem yet, it's a signal detection problem. You should be able to clear this up in a few minutes with the right instrument.

I'm assuming you're only doing this exercise because the transmitting part is one for which you cannot find a datasheet. If you had a datasheet in hand, that would clear this up, or at least suggest the possible baud rates you should try.

TomServo
  • 7,248
  • 5
  • 30
  • 47
1

Old thread but I thought it might be useful.

Something I did was write a python/pyserial script that kept cycling through different baud rates (300 - 115200) and listened and filtered for strings that aren't garbage. Something that decides easily, with the assumption that but would be good clear text so you have the right rate. It worked well enough and seemed to find the right rate more than fast enough to esc into the bootloader of my AP.

0

I tried Realterm software and found out that the data is coming at 300 Baud Rate, no parity, 8 data bits and 1 or 2 stop bits. For the remaining options, I get Framing error and break condition in the software. Thank you all...

Vishal B U
  • 17
  • 1
  • 1
  • 5