[Interest] Serial Port custom baud rate problem

Denis Shienkov scapig2 at yandex.ru
Fri Oct 18 19:41:57 CEST 2013

Hi Stefano,

 > This could be a serial port library bug or a driver issue???

It is unknown, maybe yes or maybe no. :)

You should do some debugging of the library and view the content for the 
"currentSerialInfo" struct.

For us it is interest the value of "currentSerialInfo.baud_base" field, 
see file "qserialport_unix.cpp", method QSerialPortPrivate::setBaudRate().

You should help to us for quickly resolve of this issue. Also you can do 
posting this issue to bug-report (it is preffered way, IMHO).

Best regards,

18.10.2013 19:15, Stefano Cordibella ?????:
> Thank you Frédéric for your suggestion!
> I am looking into the datasheet in order to discover these values.
> BTW the QtSerialPort library doesn't report anything and from its side 
> everithing is working properly...
> This could be a serial port library bug or a driver issue???
> I think that there is no clear border, but the low level library 
> implementation (I mean the unix system call invoked from library) may 
> be better managed in order to check that the port is properly set to 
> the requested frequency...
> Stefano.
> On 10/18/2013 01:02 PM, Frédéric Marchal wrote:
>>> 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.
>> Frederic
> -- 
> *Stefano Cordibella*
> EDALab s.r.l. - Networked Embedded Systems
> Strada Le Grazie, 15 - 37134 Verona - Italy
> email : stefano.cordibella at edalab.it
> skype : stefano.cordibella
> tel. : +39 045 802 70 85
> web : www.edalab.it
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131018/9e0f991c/attachment.html>

More information about the Interest mailing list