[Interest] Serial Port custom baud rate problem

Frederic Marchal frederic.marchal at wowtechnology.com
Sat Oct 19 13:44:28 CEST 2013


On Friday 18 October 2013 17:15:36 Stefano Cordibella wrote:
> 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...

I observed the same problem recently on a ADDI-DATA APCI-7500-3 on Windows. 
The pci board is a carrier board on which you plug from one to four serial 
interfaces. The serial interfaces have to be ordered with an oscillator 
capable of producing the baud rates you need.

We ordered a serial interface with the wrong oscillator. The driver happily 
accepted the requested baud rate without any error but the scope clearly 
showed the board to emit a signal at another baud rate.

Then I wrote a small program to scan every possible baud rate and report 
whether the baud rate was accepted or not. I found out that most of them were 
accepted and rounded up or down to the closest physically attainable baud 
rate. Only baud rates too far away from a valid baud rate returned an error. 
The accepted baud rate ranges were roughly centered on the physically valid 
baud rates.

In my case, I used the Windows API. Therefore, I can't speak about Qt or 
Linux. It may not qualify as a driver issue either. It is how the driver works 
by design. The manufacturer might even call it a feature :-)

Frederic




More information about the Interest mailing list