[Interest] Serial Port custom baud rate problem

Stefano Cordibella stefano.cordibella at edalab.it
Fri Oct 18 17:15:36 CEST 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131018/0ce98d9c/attachment.html>


More information about the Interest mailing list