Skip to contentSkip to conversation

USB to Serial converter code pl2303

DISCUSSION Magnus 6 participants 10 messages Feb 18, 2014 – Feb 21, 2014 2 messages not in the archive TTY layer and serial drivers

lore
Share & tools
lore

Magnus

author
#0 lore raw

Hi,

I just bought a Plexgear USB to serial adapter that i wanted to use for a robot that im building.

This works fine via a serial connection, but now i want my new Raspberry PI mini computer to handle the chip and it only has USB unless i connect some special Raspberry converter that i cant buy where i live atm and dont know if itll work for this kind of controller chip.

After plugging in the plexgear adapter into my linux boxes:
Fedora 18, Debian 3.11.0-15-generic #25-Ubuntu and weezy it doesnt send any commands to the servo controller chip on the other side of the converter.

I can open the port /dev/ttyUSB0 and send to it with stty, but not a beep on the other side. I have also set the tty Baudrate manually to 2400 but this made no difference. My code does this as well including setting stopbit
parity and so on.

The robot controller chip only handles 2400 Baud but is fast enough for the connected servos to spin around as fast as possible. Those are up to 5 regular rc-servos running on 9 volts and controlled via a FT639/EDE639 chip that i made some code for many years ago for Linux.

Some data i get from Linux and Plexgear converter follows:

$ lsmod | grep pl2303
pl2303                 18527  0 
usbserial              38603  1 pl2303
$ lsusb
Bus 005 Device 007: ID 067b:2303 Prolific Technology, Inc.
PL2303 Serial Port
$ lsusb -v

Bus 005 Device 007: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

Couldn't open device, some information will be missing (My comment... hmm, but it can read from it ?)..

Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10

  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x067b Prolific Technology, Inc.
  idProduct          0x2303 PL2303 Serial Port
  bcdDevice            3.00
  iManufacturer           1 
  iProduct                2 
  iSerial                 0 
  bNumConfigurations      1

Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x000a 1x 10 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0

I can code some, but i dont know where to start so any help on this is highly appreciated.

When i google to find info on adapters i read that "bMaxPacketSize0 64" indicates that its a counterfeit product but i paid 250 Swedish for it and that not very cheap for a univeristy student i think.

This is what it looks like,
(It has a sticker on it saying its from China):
https://serialio.com/sites/default/files/images/USB-RS232-Cable-med-wm1.jpg

Sincerely,
Magnus-swe

#1 lore raw

[ Please make sure to CC the linux-usb list as well. ]

Quoted 9 lines · Magnus

After plugging in the plexgear adapter into my linux boxes:
Fedora 18, Debian 3.11.0-15-generic #25-Ubuntu and weezy it doesnt send any commands to the servo controller chip on the other side of the converter.

I can open the port /dev/ttyUSB0 and send to it with stty, but not a beep on the other side. I have also set the tty Baudrate manually to 2400 but this made no difference. My code does this as well including setting stopbit parity and so on.

First verify that the converter works by connecting it to a serial port on your PC and using a terminal program such as minicom at 115200 baud (and the same port settings including flow control) on both ends.

Also make sure you got the wiring right (e.g. use a null-modem cable).

Quoted 85 lines

Some data i get from Linux and Plexgear converter follows:

$ lsmod | grep pl2303
pl2303                 18527  0 
usbserial              38603  1 pl2303
$ lsusb
Bus 005 Device 007: ID 067b:2303 Prolific Technology, Inc.
PL2303 Serial Port
$ lsusb -v

Bus 005 Device 007: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

Couldn't open device, some information will be missing (My comment... hmm, but it can read from it ?)..

Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10

  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x067b Prolific Technology, Inc.
  idProduct          0x2303 PL2303 Serial Port
  bcdDevice            3.00
  iManufacturer           1 
  iProduct                2 
  iSerial                 0 
  bNumConfigurations      1

Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x000a 1x 10 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0

Quoted 7 lines

I can code some, but i dont know where to start so any help on this is highly appreciated.

When i google to find info on adapters i read that "bMaxPacketSize0 64" indicates that its a counterfeit product but i paid 250 Swedish for it and that not very cheap for a univeristy student i think.

This device is likely not a clone, but should be supported by the pl2303 driver either way (at least at 115200 baud).

Good luck,
Johan

author
#2 lore raw
Quoted 1 line

[ Please make sure to CC the linux-usb list as well. ]

Sure Johan.

I have visited several stores today that should have had either a null-modem or another type of USB to serial converter but unfortunately this was not the case.
The store owners even thought that this should be something that they had available at all times and dove down into piles of cables but came up empty.

The brand of this USB-Serial converter is sold by or as "Plexgear" or "Marquant".

Absolutely no info on the adapter is provided in the package other then a mini-cd saying its a "prolific" product.

I tried to send initialization code "117" followed by servo movement codes to it via gtkterm.
The only time the adapter responded was at 115200 Baud.

I need an adapter that can handle 2400 Baud to talk to the ft639/ede639 servo controller chip or possibly a pl2303 driver that is improved. I have looked at vscom, a very similar looking adapter on all counts except shape.
This adapter uses a linux driver called "ftdi_sio" from info i have read on the net.

What im really looking for here is an usb to serial adapter that works for 2400 Baud and not only 115200. I guess ill have to buy a new one from somewhere, but im missing the what and the where :)

Sincerely,
Magnus

Quoted 117 lines

[ Please make sure to CC the linux-usb list as well. ]

Quoted 9 lines · Magnus

After plugging in the plexgear adapter into my linux boxes:
Fedora 18, Debian 3.11.0-15-generic #25-Ubuntu and weezy it doesnt send any commands to the servo controller chip on the other side of the converter.

I can open the port /dev/ttyUSB0 and send to it with stty, but not a beep on the other side. I have also set the tty Baudrate manually to 2400 but this made no difference. My code does this as well including setting stopbit parity and so on.

First verify that the converter works by connecting it to a serial port on your PC and using a terminal program such as minicom at 115200 baud (and the same port settings including flow control) on both ends.

Also make sure you got the wiring right (e.g. use a null-modem cable).

Quoted 85 lines

Some data i get from Linux and Plexgear converter follows:

$ lsmod | grep pl2303
pl2303                 18527  0 
usbserial              38603  1 pl2303
$ lsusb
Bus 005 Device 007: ID 067b:2303 Prolific Technology, Inc.
PL2303 Serial Port
$ lsusb -v

Bus 005 Device 007: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

Couldn't open device, some information will be missing (My comment... hmm, but it can read from it ?)..

Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10

  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x067b Prolific Technology, Inc.
  idProduct          0x2303 PL2303 Serial Port
  bcdDevice            3.00
  iManufacturer           1 
  iProduct                2 
  iSerial                 0 
  bNumConfigurations      1

Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x000a 1x 10 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0

Quoted 7 lines

I can code some, but i dont know where to start so any help on this is highly appreciated.

When i google to find info on adapters i read that "bMaxPacketSize0 64" indicates that its a counterfeit product but i paid 250 Swedish for it and that not very cheap for a univeristy student i think.

This device is likely not a clone, but should be supported by the pl2303 driver either way (at least at 115200 baud).

Good luck,
Johan

#3 lore raw
Quoted 2 lines · Magnus
Quoted 1 line

[ Please make sure to CC the linux-usb list as well. ]

Sure Johan.

[ And please try to avoid top-posting... ]

Quoted 6 lines

The brand of this USB-Serial converter is sold by or as "Plexgear" or "Marquant".

Absolutely no info on the adapter is provided in the package other then a mini-cd saying its a "prolific" product.

Quoted 7 lines

I tried to send initialization code "117" followed by servo movement codes to it via gtkterm.
The only time the adapter responded was at 115200 Baud.

I need an adapter that can handle 2400 Baud to talk to the ft639/ede639 servo controller chip or possibly a pl2303 driver that is improved.

The pl2303-driver can handle 2400 baud, but not sure exactly what baud rates are available for a cloned/pirated pl2303 chip (if that is what you've got). 115200 baud should be supported, though.

Quoted 4 lines

I have looked at vscom, a very similar looking adapter on all counts except shape. This adapter uses a linux driver called "ftdi_sio" from info i have read on the net.

That driver also works at 2400 baud.

Quoted 4 lines

What im really looking for here is an usb to serial adapter that works for 2400 Baud and not only 115200. I guess ill have to buy a new one from somewhere, but im missing the what and the where :)

I only suggested using 115200 baud as a way to verify your setup. Once you do that you can try 2400.

Good luck,
Johan

#4 lore raw

Am 19.02.2014 18:00, schrieb Johan Hovold:

Quoted 6 lines

I need an adapter that can handle 2400 Baud to talk to the ft639/ede639 servo controller chip or possibly a pl2303 driver that is improved.
The pl2303-driver can handle 2400 baud, but not sure exactly what baud rates are available for a cloned/pirated pl2303 chip (if that is what you've got). 115200 baud should be supported, though.

We have tested different baud rates with the PL2303HX china clones.
All are working including non standard baud rates.
But the non standard baud rates are only available with the modified driver from Frank Schäfer.

Cheers
Karsten
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
In reply to a message not in the archive
Quoted 10 lines · Karsten Malcher

Am 19.02.2014 18:00, schrieb Johan Hovold:

Quoted 6 lines

I need an adapter that can handle 2400 Baud to talk to the ft639/ede639 servo controller chip or possibly a pl2303 driver that is improved.
The pl2303-driver can handle 2400 baud, but not sure exactly what baud rates are available for a cloned/pirated pl2303 chip (if that is what you've got). 115200 baud should be supported, though.

We have tested different baud rates with the PL2303HX china clones. All are working including non standard baud rates.

Ok, good, so 2400 baud should work.

Quoted 2 lines

But the non standard baud rates are only available with the modified driver from Frank Schäfer.

What driver is that? The latest clone-related patch from Frank that I've seen stated:

"According to Prolific, several (unauthorized) cheap and less
functional clones of the PL2303HX chip are in circulation. [1] I've had the chance to test such a cloned device and it turned out that it doesn't support any baud rates above 115200 baud (original: 6 Mbaud) It also doesn't support the divisior based baud rate encoding method, so no continuous baud rate adjustment is possible."

Thanks,
Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw

Am 19.02.2014 18:14, schrieb Johan Hovold:

Quoted 11 lines · Karsten Malcher
Quoted 9 lines

Am 19.02.2014 18:00, schrieb Johan Hovold:

Quoted 6 lines

I need an adapter that can handle 2400 Baud to talk to the ft639/ede639 servo controller chip or possibly a pl2303 driver that is improved.
The pl2303-driver can handle 2400 baud, but not sure exactly what baud rates are available for a cloned/pirated pl2303 chip (if that is what you've got). 115200 baud should be supported, though.

We have tested different baud rates with the PL2303HX china clones. All are working including non standard baud rates.

Ok, good, so 2400 baud should work.

Yes - this should be no problem with every usb converter. I have different one and all of them are usable now.

Quoted 6 lines
Quoted 3 lines

But the non standard baud rates are only available with the modified driver from Frank Schäfer.

What driver is that? The latest clone-related patch from Frank that I've seen stated:

Quoted 7 lines

"According to Prolific, several (unauthorized) cheap and less
functional clones of the PL2303HX chip are in circulation. [1] I've had the chance to test such a cloned device and it turned out that it doesn't support any baud rates above 115200 baud (original: 6 Mbaud) It also doesn't support the divisior based baud rate encoding method, so no continuous baud rate adjustment is possible."

That's a good question.
He send me a special debug version that gives all registers of the PL2303HX after the plugin. I think it is better when Frank directly suffer us with his latest version.

Cheers
Karsten

Quoted 3 lines

Thanks,
Johan

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw
In reply to Johan Hovold

Am 19.02.2014 18:14, schrieb Johan Hovold:

Quoted 10 lines · Karsten Malcher
Quoted 9 lines

Am 19.02.2014 18:00, schrieb Johan Hovold:

Quoted 6 lines

I need an adapter that can handle 2400 Baud to talk to the ft639/ede639 servo controller chip or possibly a pl2303 driver that is improved.
The pl2303-driver can handle 2400 baud, but not sure exactly what baud rates are available for a cloned/pirated pl2303 chip (if that is what you've got). 115200 baud should be supported, though.

We have tested different baud rates with the PL2303HX china clones. All are working including non standard baud rates.

Urgh... Karsten... don't confuse the people. :/
Yes, _your_ clones behave exactly like HX originals, but others don't.

Quoted 1 line

Ok, good, so 2400 baud should work.

Indeed.
Even the bad clones should support all standard baud rates up o 115200.

Quoted 6 lines
Quoted 3 lines

But the non standard baud rates are only available with the modified driver from Frank Schäfer.

What driver is that? The latest clone-related patch from Frank that I've seen stated:

Quoted 7 lines

"According to Prolific, several (unauthorized) cheap and less
functional clones of the PL2303HX chip are in circulation. [1] I've had the chance to test such a cloned device and it turned out that it doesn't support any baud rates above 115200 baud (original: 6 Mbaud) It also doesn't support the divisior based baud rate encoding method, so no continuous baud rate adjustment is possible."

This patch is still 100% valid.
The "good" clones are detected as originals, which is fine.

Regards,
Frank

Quoted 6 lines

Thanks,
Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#10 lore raw
In reply to a message not in the archive
Quoted 12 lines · Frank Schäfer

Am 19.02.2014 18:14, schrieb Johan Hovold:

Quoted 10 lines

What driver is that? The latest clone-related patch from Frank that I've seen stated:

"According to Prolific, several (unauthorized) cheap and less
functional clones of the PL2303HX chip are in circulation. [1] I've had the chance to test such a cloned device and it turned out that it doesn't support any baud rates above 115200 baud (original: 6 Mbaud) It also doesn't support the divisior based baud rate encoding method, so no continuous baud rate adjustment is possible."

Quoted 2 lines

This patch is still 100% valid.
The "good" clones are detected as originals, which is fine.

Good to know. Thanks for clarifying.

Care to respin your refined-device-detection patches against the updated driver in v3.14-rc?

Thanks,
Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw
In reply to Frank Schäfer

Am 20.02.2014 19:19, schrieb Frank Schäfer:

Quoted 4 lines
Quoted 2 lines

We have tested different baud rates with the PL2303HX china clones. All are working including non standard baud rates.

Urgh... Karsten... don't confuse the people. :/
Yes, _your_ clones behave exactly like HX originals, but others don't.

O.K. - all of them is not correct.
My meaning was all i have tested from the PL2303HX clones.

At least all standard driver only support the standard baud rates.
That's sufficient for nearly all purposes.
But if someone needs to support non standard baud rates, it might be good to know that this is possible with some chips.

Cheers
Karsten
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html