Subject: Re: 2 stop-bits and 8 data bits?
To: David Wetzel <dave@turbocat.de>
From: Robert Elz <kre@munnari.OZ.AU>
List: netbsd-help
Date: 03/16/2000 12:40:06
    Date:        Wed, 15 Mar 2000 12:58:34 +0100
    From:        David Wetzel <dave@turbocat.de>
    Message-ID:  <200003151158.MAA00302@cat.turbocat.de>

  | What should I use in term.c_cflag?

  |     term.c_cflag = B19200|CS8|CSTOPB|CLOCAL;

I can't decode QBASIC - but that looks right to request 2 stop bits,
and 8 bit data with no parity @19200.

Do be aware that these settings only last as long as the device remains
open - that is, you can't run a program to make the settings and then
run another that you hope will use them - if you absolutely have to
have thing slpit, then a horrible hack of forcing the device to
remain open (often as simple as "sleep 3600 >/dev/tty01 &") is needed.

But if your old hardware is really that sensitive (the thing you're
attempting to communicate with), it is entirely likely that just having
2 stop bits might not be enough - I have no idea how good QBASIC
(under wintrash/dos ?) is at keeping the serial line busy, but NetBSD
is likely to be very good - the characters will come as close together
as the settings allow - the qbasic program might actually be inserting
slightly longer delays between characters than just the 2 stop bits force
(nb: I am guessing).   As a desperate first measure to see if the rest
of the programming is correct (and providing the thing at the other end
doesn't have timeouts on received data), try writing just one byte at
a time, and sticking a sleep(1) after each character.   If that works
then you at least know that the data is all correct, and it is just a
timimg issue you have to solve.

kre