多产的PL2303串行端口达到250000bps [英] Prolific PL2303 serial port to 250000bps

查看:125
本文介绍了多产的PL2303串行端口达到250000bps的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用c以250kbps的速度运行/dev/ttyUSB0(多产的pl2303 USB-RS232转换器).我到处看,每个人都说最近的可达到的速度是230400 bps(

I need to run my /dev/ttyUSB0 (prolific pl2303 USB-RS232 converter) at 250kbps 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 the values defined in baud_sup are supported !"). But I'm 100% sure that it can be done, because on windows (using c# default SerialPort component) I can just set 250000 as the baudrate, and it wil happily put out data at that speed (measured with an oscilloscope, so it's not switching to the nearest available or to 9600 as described in the linux driver at line 325!).

有人知道在Linux中设置自定义波特率的方法吗?

Does anyone know a way to set tat custom baudrate in linux?

在您问之前,我已经开发出一种能够以250kbps的速度进行通信的设备,这种速度是必需的,并且是我可以不出错地获得的最高速度,所以我不能改变它.

And before you ask, I have developed a device that communicates at 250kbps, that speed is needed and is the highest I can get without errors, so no I can't change it.

推荐答案

这是Linux驱动程序中的问题.从第333 行到第348行,即驱动程序强制波特率.删除该代码,将使用公式 12 *计算波特率1000 * 1000 * 32/波特,并且在250kbps时产生0%的错误,与我在Windows上获得的结果完全一致.我期待改进官方驱动程序.

It's a problem in the linux driver. From line 333 to line 348, the driver forces a baudrate. Removing that code, the baudrate gets calculated with the formula 12*1000*1000*32 / baud, and that gives an error of 0% at 250kbps, perfectly in line with what I get on windows. I'm looking forward to improve the official driver.

这篇关于多产的PL2303串行端口达到250000bps的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆