5

Within a bash script, I use the following:

$ 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:

$ 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:

$ 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. Trying 250 kBd the error message is different:

$ 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.

I'm working on Kubuntu 12.04, 32 Bit. 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)?

Community
  • 1
  • 1
Joe
  • 3,090
  • 6
  • 37
  • 55
  • 3
    Why do you say your adapter is "ftdi based" when it clearly uses a Prolific chip or clone thereof? Prolific and FTDI are *competitors*. – Chris Stratton Mar 12 '14 at 19:00
  • Typically the process for a *buntu distribution would be to get the running kernel version from `uname` and obtain the corresponding kernel source package. Then you can do a `make modules` and verifying that you get a working driver module (with no changes from what already shipped). Then you can edit it to make this functional change, and rebuild. You could also just get the kernel-headers package and get the module source from somewhere else to build our of tree, but you'd need to be sure to get a version compatible with your kernel version. – Chris Stratton Mar 12 '14 at 19:03
  • Thanks for the info »Prolific and FTDI are competitors«, I'd corrected that in the question. – Joe Mar 12 '14 at 20:24
  • Are you sure it supports a rate that high? – Shane Wealti Mar 25 '14 at 12:53
  • Unfortunately, I have no specification about it's max baudrate. For the most Usb to RS232 adapters, the baudrate is limited by the RS232 level shifter (TTL to RS232 pegel). I've seen Ftdi based adapters which are limited to 230.4 kBd even though the FT232R is capable to run at 1 MBd or more (IMHO up to 3 MBd). I'm currently testing with [Ftdi US232R-10](http://www.ftdichip.com/Products/Cables/USBRS232.htm) which is specified for 1 MBd – Joe Mar 25 '14 at 16:24

1 Answers1

1

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.

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).

Configuring this device using stty like:

$ stty -F /dev/ttyUSB0 1000000 raw

works successfully.

Joe
  • 3,090
  • 6
  • 37
  • 55
  • This is not an answer to the original question. – unwind Apr 07 '14 at 07:37
  • Ok, I'd added the correct working command line call now. Yes, I don't describe how to fix the PL2303 driver bug, but I provide an answer to the questions part »Or does someone know an alternate USB to RS232 adapter which works at 1 MBd«. – Joe Apr 07 '14 at 08:51
  • Additional information: After some resarch, I got the Ftdi US232R-10 also run at 1 MBd on OS X Yosemite - it's ab bit complicated, but possible. – Joe Feb 04 '15 at 11:45
  • @Joe: Can you tell us something more about the complicated method for OS X? I'm interested! – Zappel Oct 13 '15 at 14:35
  • It's some month ago that I'd done that with OS X and from collegues I know, that the way I'd succeed in Februars not longer works with current versions of OS X. I'd heard that it is still possible, but unfortunately don't know how. Please check [google ftdi baudrate aliasing osx](https://www.google.com/search?q=ftdi+baudrate+aliasing+osx) – Joe Oct 13 '15 at 20:40