Re: Serial (RS232) communication - failing to detect stop bit
- From: Doug Mitton <doug_mitton@xxxxxxxxxxxxx>
- Date: Thu, 13 Sep 2007 09:37:55 -0400
"arka.n.roy" <arka.n.roy@xxxxxxxxx> wrote:
I need to use my Gentoo machine to obtain data from an external
instrument via a 9-pin serial port. Very old stuff.
It was not working, so I have been trying to diagnose the problem.
I bought a cable that is called a "cross cable" in Japan (where I am
located), I think this corresponds to what is called a "null-modem
cable" in America. Both ends are female, and it is used to directly
connect 2 PCs.
So here is the setup:
PC-1: Gentoo OS
PC-2: Has partitions for both Windows XP and Xandros Linux.
I have narrowed things down to where I realize I am getting the
following.
If I run the following command on the Gentoo machine (PC-1):
cat /proc/tty/driver/serial
I get, along with the number of bytes transfered by rx and tx, I also
get fe:2, which I assume means two frame errors.
The rx figure is correct in that it jives with the number of bytes I
sent from PC-2... this indicates that the Gentoo machine IS receiving
data. However maybe the fe:2 means that it is not detecting the stop
bits, and this is preventing it from displaying output text in
minicom.
I have checked and rechecked that all the settings (bit rate, parity
etc) all match on both machines. I am wondering if there is some
factor in the kernel that is making it not recognize the stop bit. I
have had other indications as well that a stop bit or a terminator is
not being detected (long story). What are some possible causes?
(e.g. the OS is doing too much interrupting or not enough?)
There is one other area to check in Linux ... the "terminal settings".
The defaults can be different between distros.
This is the `stty` command.
For instance, my dialup modem looks like this:
<P8>:~$ stty -F /dev/ttyS2
speed 115200 baud; line = 0;
min = 1; time = 0;
-brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
<P8>:~$
and my direct connect line looks like this:
<P8>:~$ stty -F /dev/ttyS1
speed 9600 baud; line = 0;
-brkint -imaxbel
<P8>:~$
Hope this helps! Good luck!
--
------------------------------------------------
http://www3.sympatico.ca/dmitton
SPAM Reduction: Remove "x." from my domain.
------------------------------------------------
.
- Follow-Ups:
- Re: Serial (RS232) communication - failing to detect stop bit
- From: arka.n.roy
- Re: Serial (RS232) communication - failing to detect stop bit
- Prev by Date: Re: Serial (RS232) communication - failing to detect stop bit
- Next by Date: Re: Serial (RS232) communication - failing to detect stop bit
- Previous by thread: Re: Serial (RS232) communication - failing to detect stop bit
- Next by thread: Re: Serial (RS232) communication - failing to detect stop bit
- Index(es):