LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-14-2006, 08:56 AM   #1
zhanghao
LQ Newbie
 
Registered: Feb 2006
Posts: 4

Rep: Reputation: 0
Serial line RTS and DTR setting


I'm trying to make my Linux box to talk to a DCE via RS232. It is required that the the RTS line on the DTE side be set to -12 VDC and the DTR be +12 VDC. Is there a command in Linux to do this? Thank you.

Hao
 
Old 02-14-2006, 09:47 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
In all the time I worked with rs232c connections (modems, terminals, printers and device to device) I never had to specify voltage.

On a quick check of the standard I suspect you are misreading. I think it is just telling you it uses that voltage - not that you need to configure it.

FYI: If you're doing a modem this matters but for most other connections if you can use software flow control (XON/XOFF) you can just jumper. For most connections other than modems on a DB25 D shell connector I'd jumper pin 4 to 5 and then jumper 20, 6 and 8 to each other for software flow control. (The 20, 6 and 8 usually were really only necessary for serial printers.) By doing such jumpering it forces the device to answer itself on any extraneous sends. Bascially one only needs pins 2 (TX), 3 (RX) and 7 (Ground) for software flow control. DTE to DTE you send 2 on one side to 3 on the other (and vice versa) and on DTE to DCE you just send them straight across. Pin 7 would always be straight across. These rules came from DB25 but apply to RJ45 (of course there is no 20 on RJ45 though). For a DB9 you'd have to look up the specifics of which pin is which.

Last edited by MensaWater; 02-14-2006 at 09:49 AM.
 
Old 02-14-2006, 03:14 PM   #3
zhanghao
LQ Newbie
 
Registered: Feb 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jlightner
In all the time I worked with rs232c connections (modems, terminals, printers and device to device) I never had to specify voltage.
Thanks jlightner. Actually I realized the way I put this was a little confusing. What I wanted to find out was how to toggel the RTS and DTR lines of the COM port in Linux.

The DCE I'm working on is a little tricky. You have to set the DTR high AND RTS low to establish a communiction. I have done this successfully on a WindowsXP machine and just need to fighure out how to do the same thing under Linux.
 
Old 02-14-2006, 03:28 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Haven't done that. Usually I've just enabled or disabled various parameters (e.g. "stty -crtscts" to disable CTS/RTS handshaking).

You might have a look at the "stty" command to see if it helps with what you want to do. (Type "man stty" or "info stty" to see documentation about it.) This is the command that does serial line conditioning in Linux.
 
Old 02-14-2006, 03:53 PM   #5
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
I would just strap them to something thats already high/low in the cable. If the DCE is giving out DSR+ then strap DSR to DTR on the DCE. If the DCE is giving DCD- then use DCD to strap RTS low. That way it doesn't matter what OS you use it'll work. A break-out-box is always handy for figuring out what to use to. Five minutes with a soldering iron will sort you out.
 
Old 02-14-2006, 04:34 PM   #6
zhanghao
LQ Newbie
 
Registered: Feb 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by baldy3105
I would just strap them to something thats already high/low in the cable. If the DCE is giving out DSR+ then strap DSR to DTR on the DCE. If the DCE is giving DCD- then use DCD to strap RTS low. That way it doesn't matter what OS you use it'll work. A break-out-box is always handy for figuring out what to use to. Five minutes with a soldering iron will sort you out.
I tried to jump some pins on the DCE side , hoping to make the device think it got the high/low staus it wanted. It didn't work and I checked the DCE pin voltages. Turned out they are all zero. Then I realized a partial handshaking cale wouldn't work in this particular case.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Serial line RTS and DTR setting zhanghao Linux - Hardware 1 02-15-2006 08:43 AM
Serial Port : How do I raise DTR ttumelty Programming 3 08-26-2005 04:17 AM
How to disable serial line eaglegst Debian 2 05-28-2004 03:10 AM
How to disable Serial Line IP ( sl0 ) mairul Linux - Newbie 7 12-21-2003 06:02 AM
Controlling serial port RTS pin from 'C' program dcarter Slackware 1 09-26-2003 07:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:49 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