Q: RS-232 output bit number 8 is zeroed.

Q: RS-232 output bit number 8 is zeroed.

Post by Roy Willy Hau » Thu, 03 Apr 1997 04:00:00



Hi.

I am trying to communicate with a hardware device by using a serial port
on an SGI. When checking the data on the line between my machine and the
device with an analyzer, I can see that whenever bit number 8 is a 1 it
is always changed to a 0 (probably by the device driver).

'tcgetattr' tells me that CS8 is correctly set, and so do 'stty -a <
/dev/ttyd2' tell me after my program has run. Ordinary ASCII
communication works fine.

How do I correctly specify the driver/port to use all 8 bits for input
and output?

All help is appreciated!

Regards

Roy Willy Haug
--
Roy Willy Haug
Kongsberg Spacetec AS
N-9005 Tromsoe
NORWAY

 
 
 

Q: RS-232 output bit number 8 is zeroed.

Post by Andrew Giert » Thu, 03 Apr 1997 04:00:00


 Roy> How do I correctly specify the driver/port to use all 8 bits for input
 Roy> and output?

Make sure that parity is disabled (-parenb). Also, make sure istrip is
disabled (-istrip); that's only supposed to affect input though. Try
turning off opost, in case your system has any non-standard output
processing options turned on.

From your description, though, you have done the right things by checking
CS8, so I'm only guessing at alternatives.

--
Andrew.

comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>

 
 
 

Q: RS-232 output bit number 8 is zeroed.

Post by Eric Levene » Fri, 04 Apr 1997 04:00:00



Quote:>I am trying to communicate with a hardware device by using a serial port
>on an SGI. When checking the data on the line between my machine and the
>device with an analyzer, I can see that whenever bit number 8 is a 1 it
>is always changed to a 0 (probably by the device driver).

>'tcgetattr' tells me that CS8 is correctly set, and so do 'stty -a <
>/dev/ttyd2' tell me after my program has run. Ordinary ASCII
>communication works fine.

>How do I correctly specify the driver/port to use all 8 bits for input
>and output?

stty -istrip

--

--------------------------------------------------------------------
ric Lvnez              "Felix qui potuit rerum cognoscere causas"

(NeXTMail, MIME)                                   Georgica, II-489
--------------------------------------------------------------------