Serial config, Stop Bits

On the .begin() function theres the chance to use a second argument "config" which adjusts parity, number of bits in the data and stop bits.

https://www.arduino.cc/en/Serial/Begin

The use of changing the number of bits, or parity seem obvious, but the number of stop bits confuses me. Since a stop bit is high, and the default value of TX is also high, whats the difference between using 2 stop bits or just using 1 stop bit and a gap between the next byte? They would both appear as a double long high signal.

Since the arduino would only begin reading the new byte once it sees the start bit, why is there any point to changing the number of stop bits? Is there a difference between 2 stop bits and 1 stop bit and a gap?

You're right. An extra stop bit does not affect the transmission except for the added one bit delay.

Some ancient devices weren't fast enough to process a character in one character time so by requiring two stop bits they could get themselves an extra bit time to do their processing. This is probably a hold-over from a time when Async ASCII was used between mechanical teletypes. If your mechanism could not keep up with 11 characters per second (110 baud) you could slow the character rate down by requiring an extra bit of delay between characters.

...and a few extra null characters after a carriage return. BT,DT.

And a line-feed after a carriage-return, come to that!

Ah, the smell of hot oil and clunking of keyboards with ~1cm travel on the keys! https://en.wikipedia.org/wiki/Teletype_Model_33

If the Arduino is interfacing with a device that uses two stop bits, will there be a problem if the Arduino uses the default serial config? Would there be issues with reading from the device, or writing to it?

TGGeko: If the Arduino is interfacing with a device that uses two stop bits, will there be a problem if the Arduino uses the default serial config? Would there be issues with reading from the device, or writing to it?

Why not just configure the Serial port as required by the external device?

Why not try it?

TGGeko: If the Arduino is interfacing with a device that uses two stop bits, will there be a problem if the Arduino uses the default serial config? Would there be issues with reading from the device, or writing to it?

Certainly not reading from it. The extra stop bit would be seen as a slight delay before the next start bit.

Sending 8N1 to a device that requires 8N2 could easily cause framing errors and may cause almost every character to fail. If the receiving hardware actually CHECKS for a second stop bit it will usually find the next start bit instead. Since they are of opposite polarity it would signal a framing error.

If the devices receiving hardware is not checking but is depending on that extra delay to set up for the next character it may start looking for the next start bit too late. If the rising edge happens before the hardware is ready to sense it the next byte will also signal a framing error. The hardware will have to wait for the next rising edge to use as a start bit. This is probably in the middle of the character. Then it will count off the 8 bit times for data and look for the first stop bit.

You should send whatever format and bit rate the receiver requires.

johnwasser: You should send whatever format and bit rate the receiver requires.

See, here's the rub. The supplier who makes the device I'm testing says they only use 1 stop bit. However, when I read the bits off an oscilloscope, there is interbyte spacing of 1 period. To the scope, its indistinguishable from two stop bits. Should I config the serial to 8N2 just to be safe?

Should I config the serial to 8N2 just to be safe?

What feels safe, and what actually works, may not be the same thing.