LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
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


Reply
  Search this Thread
Old 06-19-2009, 05:37 PM   #1
cordata
LQ Newbie
 
Registered: Nov 2008
Posts: 9

Rep: Reputation: 0
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.
 
Old 06-20-2009, 01:26 PM   #2
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,971
Blog Entries: 46

Rep: Reputation: 3195Reputation: 3195Reputation: 3195Reputation: 3195Reputation: 3195Reputation: 3195Reputation: 3195Reputation: 3195Reputation: 3195Reputation: 3195Reputation: 3195
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.
 
Old 06-21-2009, 12:09 PM   #3
cordata
LQ Newbie
 
Registered: Nov 2008
Posts: 9

Original Poster
Rep: Reputation: 0
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.
 
Old 06-21-2009, 06:44 PM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,971
Blog Entries: 46

Rep: Reputation: 3195Reputation: 3195Reputation: 3195Reputation: 3195Reputation: 3195Reputation: 3195Reputation: 3195Reputation: 3195Reputation: 3195Reputation: 3195Reputation: 3195
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.
 
Old 06-22-2009, 09:47 AM   #5
cordata
LQ Newbie
 
Registered: Nov 2008
Posts: 9

Original Poster
Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setup serial port at 1200b, 7bits, even parity and 1 top bit seraph-seph Programming 5 10-21-2006 01:57 PM
pilot-link not working with USB Serial-USB Converter with m105 calmofthestorm Linux - Laptop and Netbook 0 09-03-2005 03:03 PM
USB to Serial Converter on Serial Modem bongski55 Linux - General 3 08-29-2005 11:04 AM
Device driver for a USB to RS-232 Serial DB9 Adapter for red Hat 8 or 9 sp022 Linux - Hardware 1 04-18-2005 10:39 AM
minicom with a USB to RS-232 converter chozzie Linux - Software 0 11-12-2003 03:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration