Subject: Re: 2 stop-bits and 8 data bits?
To: Jon Lindgren <jlindgren@espus.com>
From: Robert Elz <kre@munnari.OZ.AU>
List: netbsd-help
Date: 03/14/2000 23:48:27
    Date:        Tue, 14 Mar 2000 06:09:39 -0500 (Eastern Standard Time)
    From:        Jon Lindgren <jlindgren@espus.com>
    Message-ID:  <Pine.WNT.4.21.0003140605190.338-100000@a28043.net.slk.com>

  | > how can I set 2 stop-bits and 8 data bits with sgttyb?

  | Someone correct me if I'm wrong, but I don't think you can.

That depends upon whose restriction you're reporting.   If NetBSD's
then no comment.   If serial lines, then that's not correct - you can
have as many "stop bits" as you like - thousands if you want to, a stop
bit is just a delay between the end of one character and the start of the
next.  At least one is mandatory (for async operations), to provide some
separation between characters - it allows the start bit to be recognised,
but beyond that, the sky is the limit.

Most hardware has a way to select 1 or 2 stop bits (2 is useful only when
you're transmitting to some absurdly ancient, and usually entirely wired,
that is, no processor, equipment that needs that extra gap to function).
Sometimes 1.5 stop bits can be manufactured as well, one way or another.

It is a little hard to imagine a modern application where more than a single
stop bit would be useful at all.

  | The 8th data bit "robs" the space of the 2nd stop
  | bit (and a parity bit, if IIRC).

Frequently, the 8th data bit is an alternate to the parity bit, but that's
not required either, data can be anything from 5 to 8 bits usually, and
parity is an optional extra bit.  But as most devices send and receive 8
bits (plus start and stop bits) if you don't want to risk losing sync,
you need to do the same, which means 7 data and parity, or 8 data and no
parity - but when both ends agree, anything goes...

kre