简体   繁体   English

RS232控制台通信 - 将波特率设置为1 MBaud

[英]RS232 console communication - set baudrate to 1 MBaud

Within a bash script, I use the following: 在bash脚本中,我使用以下内容:

$ stty -F /dev/ttyUSB0 921600 raw
$ echo -n "some test data" >/dev/ttyUSB0

and it works as expected. 它按预期工作。 Using a PL2303 USB to RS232 adapter: 使用PL2303 USB转RS232适配器:

$ lsusb
...
Bus 006 Device 010: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 006 Device 011: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

Now I tried to do the same with 1 MBd, but got an error: 现在我尝试用1 MBd做同样的事,但是出现了错误:

$ stty -F /dev/ttyUSB0 1000000 raw
stty: /dev/ttyUSB0: unable to perform all requested operations

Also the same message when I try with 500 kBd. 当我尝试500 kBd时也是相同的消息。 Trying 250 kBd the error message is different: 尝试250 kBd的错误信息是不同的:

$ stty -F /dev/ttyUSB0 250000 raw
stty: invalid argument `250000'
Try `stty --help' for more information.

As seen here , it's a problem in the PL2303 linux driver. 正如所看到的在这里 ,它在PL2303的Linux驱动程序有问题。

I'm working on Kubuntu 12.04, 32 Bit. 我正在研究Kubuntu 12.04,32位。 Unfortunally, I don't know how to fix that driver on my system (getting driver source, patch em, compile, install … hmm, maybe I learn a bit and give it a try - advice is welcome). 不幸的是,我不知道如何在我的系统上修复该驱动程序(获取驱动程序源代码,补丁程序,编译,安装......嗯,也许我学习了一下并尝试一下 - 欢迎提出建议)。

But maybe there is an updated driver avaliable which is easy to install? 但也许有一个更新的驱动程序可用易于安装?

Or does someone know an alternate USB to RS232 adapter which works at 1 MBd (hardware flowcontrol via rts/cts is needed, which works pretty well with the PL2303)? 或者有人知道另一个USB转RS232适配器,工作在1 MBd(需要通过rts / cts进行硬件流量控制,这对PL2303非常有效)?

After the realization that »Prolific and FTDI are competitors«, I bought Ftdi US232R-10 which is a FT232R based device and specified for 1 MBd transfer rate. 在意识到»Prolific和FTDI是竞争对手«之后,我买了Ftdi US232R-10 ,这是一款基于FT232R的设备,规定传输速率为1 MBd。

With this adapter I'd successfully tested communication at 1 MBd by transfering some GiB data without any error (including usage of Rts/Cts hardware flow control). 使用此适配器,我通过传输一些GiB数据成功测试了1 MBd的通信,没有任何错误(包括使用Rts / Cts硬件流控制)。

Configuring this device using stty like: 使用stty配置此设备:

$ stty -F /dev/ttyUSB0 1000000 raw

works successfully. 工作成功。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM