[Interest] Serial Port custom baud rate problem

Frédéric Marchal frederic.marchal at wowtechnology.com
Fri Oct 18 13:02:59 CEST 2013

> Hi list,
>      I am trying to communicate via serial port with a device that use
> 125000 bps.
> When I set the custom baud rate the setBaudRate return true without
> error (I also check with debugger and the QSerialPortPrivateData
> inputBaudRate and outputBaudRate are properly set to 125000).
> But when I check with an oscilloscope the frequency of bits that came
> out from serial port the result is that the port is set to 115200...
> After sending data through serial port I print the port baudRate() and
> the value is even set to 125000.
> I am using Qt 4.8.4 (for project reason) under linux.
> Any ideas about this problem?

Is your serial port capable of emitting at a baud rate of 125kbaud?

UARTs often produce the requested baud rate by dividing an internal oscillator 
by an integer number. As such, they can only attain a fixed set of baud rates.

For instance, an internal oscillator at 460KHz can be divided by 4 to emit at 
115kbaud but it cannot generate a clock at 125kbaud.

I have seen drivers that reports an error if the requested baud rate is 
unavailable while other silently selects the closest attainable baud rate.


More information about the Interest mailing list