Valid serial port PL2303 up to 250,000 bps

I need to run my / dev / ttyUSB0 (prolific pl2303 USB-RS232 converter) at a speed of 250 Kbps using c. Everywhere I looked, everyone said that the nearest achievable speed is 230400 bps ( http://lxr.linux.no/#linux+v3.9.5/drivers/usb/serial/pl2303.c and a few lines later ( line 325) "NOTE: Only values ​​defined in baud_sup are supported!"). But I am 100% sure that this can be done, because on windows (using the C # component by default, SerialPort) I can just set 250,000 as the data transfer speed, and it will gladly put out the data at that speed (measured using oscilloscope, so it’s not switching to the nearest available or to 9600, as described in the Linux driver on line 325!).

Does anyone know a way to install tat custom baudrate on Linux?

And before you ask, I developed a device that communicates at a speed of 250 Kbps, this speed is necessary and is the highest that I can get without errors, so I can’t change it.

+3
source share
1 answer

This is a problem in the linux driver. From line 333 to line 348, the driver forcibly increases the transmission speed. By removing this code, the speed is calculated using the formula 12 * 1000 * 1000 * 32 / baud , and this gives a 0% error at a speed of 250 kbit / s, perfectly in accordance with what I get on the windows. I look forward to improving the official driver.

+2
source

Source: https://habr.com/ru/post/1531395/


All Articles