Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-19-2009, 05:37 PM
|
#1
|
LQ Newbie
Registered: Nov 2008
Posts: 9
Rep:
|
Experience with 8 bit serial AND parity with HL-340 USB-RS-232 converter?
I'm trying to run a USB to serial converter (HL-340, not PL2303) with 8 bit data plus even parity.
Does anyone have experience doing this?
It was very easy to get the device running (automatic) but it looks like parity does not work with 8 bit data. The device apparently just ignores parity with 8 data bits. 7 bit seems to work OK with or without parity.
For software I've been using minicom and some basic C programs written to manipulate the various parameters myself, no difference.
For the device connected to the other end I'm using an HP 4951C protocol analyzer which tells me the parity does not work.
Here is output of lsusb:
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 004: ID 1a86:7523 Unknown HL-340 USB-Serial adapter
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
I'm running slackware 12.2 with 2.6.27.7 kernel.
Thanks!
Last edited by cordata; 06-21-2009 at 01:53 PM.
Reason: Wrong converter name.
|
|
|
06-20-2009, 01:26 PM
|
#2
|
Moderator
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,971
|
Hi,
Do you have the pinout for the DB9 for the converter? Who's the manufacture for the converter? Do you have the specs?
The 'HP 4951C protocol analyzer' should allow you to setup any configuration. What does it show for the connector for active signals?
It's been a while for me to use 'RS232' but you should make certain the proper signals for all pins. Sometimes a null modem configuration is setup thus allowing the protocol to take care of things.
|
|
|
06-21-2009, 12:09 PM
|
#3
|
LQ Newbie
Registered: Nov 2008
Posts: 9
Original Poster
Rep:
|
Thanks for your reply. The pinout is not relevant to the question of parity. I'm using the standard data transmit / receive pins (can't remember what they are on DE-9 but on DB-25 they are 2,3,7). The other pins DSR, DTR, RTS, CTS, etc are used for modem and flow control. (I believe CLOCAL is the *nix option to disable these pins)
RS-232 uses either 10,11 or 12 bits per octet/byte transmitted. There is a start bit, then 7 or 8 data bits, then an optional parity bit, then 1 or 2 stop bits.
The "normal" modes are typically 7 data bits plus parity plus 1 stop bit -or- 8 data bits, no parity, 1 stop bit for a total of 10 bits.
8 bit data plus parity (and 1 start and stop bit) makes 11 bits which is fairly uncommon.
So what I am suspecting is that either the hardware (HL240) or software (termio family or driver) did not implement the capability of 8 data bits plus parity.
I can make things work with 16450 UART under DOS connected to my analyzer and will do further testing with 16450 / 8250 UARTs under linux.
|
|
|
06-21-2009, 06:44 PM
|
#4
|
Moderator
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,971
|
Hi,
I never said parity has anything to do with the pinout. The DB will control the device if that is the way the system is configured to rx/tx. If the device is expecting data and the proper control is not met then you indeed will have communication problems.
If you don't follow the proper protocol with the device you will experience problems in the data rx/tx.
|
|
|
06-22-2009, 09:47 AM
|
#5
|
LQ Newbie
Registered: Nov 2008
Posts: 9
Original Poster
Rep:
|
I managed to find a windows driver for the 340 device - parity works fine. (same device, same cable, etc.)(I'm using dual boot machine)
An examination of the linux driver ch341.c shows that parity was not implemented.
I downloaded a USB sniffer which I will use to figure out the correct config codes for parity. Then I will patch the driver and report my results.
|
|
|
All times are GMT -5. The time now is 04:17 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|