Bravo! Steve Thackery wrote a tremendous synopsis. I'm saving it too. A few clarifications just in case: > I'll just summarise that again, as a sanity check: a mark represents a > logic 1 and is a negative voltage, a space represents a logic 0 and is > a positive voltage. A start bit is a space (positive), a stop bit is > a mark (negative). Just note that Mario mentioned that his marks (stop) were positive and his "space"s negative. The UART or MCU sees things this way. It connects to the line via an inverting transceiver which inverts incoming and outgoing voltage levels. On the RS-232 line then, marks are negative and "space"s positive. OTOH, the "status" lines are positive- true on the RS-232 line and inverted as the UART/ MCU sees them. Now, according to the RS-232 standard, in a stable state the RS-232 (AKA EIA-232) line is at least 3V either positive or negative, but not more than 15V (or is that 18V?). That is what the 1488/ 1489 transmitter/ receiver chip, or any other equivalent, provides. In practice, designers of peripheral devices, e.g. mice, frequently cheat and use a mark of 0V and a space of 3 to 5V. The 1489 line receiver threshold unless its adjustment feature is used, is at 1.5V, so these voltages are fine for non-critical (short- range) applications. This is quite convenient, as you see 0V is interpreted as a marking or idle condition allowing hot-switching of circuits (minimizes glitches) and all sorts of other tricks. On the status lines, an open or grounded line is OFF. This leads to mention of the "break" condition. Where unipolar current loop switching was used (in those Telex machines), mark meant current on and space meant current off. The original meaning of the words in fact relates to paper tape markers using an ink roller. A telex machine in continuos mark sits quietly (sort of!) idling. If the line "breaks" however, it makes a terrific racket as without its magnet holding at all, the mechanism continuously acts on dummy characters. This is used as a fault indication. On UARTs, it is detected if the stop bit is absent and most implementations thereafter lock out until an apparent stop bit eventuates. This then is the "break" condition and there are deliberate ways of sending it. You do have to be careful of interpretation of the character detected (NUL) as the break was being received. > It is not uncommon to transmit two stop bits. Interestingly, in this > case you can configure the receiver to expect either one or two and it > will still work. In most implementations, the UART is set *as a whole* for one or two (or 1¸) stop bits. While the extra stop bits were needed for the mechanical implementations, UARTs only look for the first, so this setting actually affects only the transmitter; the receiver sees the extra merely as an inter-character delay. If you expect any problems at all, two stop bits is a good setting as, should the receiver get out of synch due to noise pulses during a burst of characters, the extra delays will pull it back into synch within about 8 "bad" characters at the most. > You might be interested to know that the worldwide telex standard uses > a five bit code, with a stop bit one-and-a-half bits long! This gives > 7 1/2 bits per character. I have a SAGEM electronic telex, hopefully well-covered, in my repository. AFAIK, the Telex service became obsolete about 8 years ago. (The FAX machine killed it!) Some variants still operate on HF radio though, and Amateurs still play with it. Anybody know of residual land-line use? I can imagine the Telex version of the recent Morsecodian thread... Wagner Lipnharski wrote: > The receiver needs to save or do something with each received byte, it > demands some time, and normally this is done right after sensing (and > during) the stop bit time. Old and slow machines sometimes needs an > extra time. That's talking about *machines*, but the significance is that "bit- banging" implementations on MCUs may also need that extra time, particularly at high baudrates. Interrupt-driven and hardware implementations generally don't. > It doesn't make sense to program the receiver with more than one stop > bit, since with ONE STOP BIT it will works with data arriving with 1, > 1¸ or 2 stop bits, always. It's not significant. You aren't programming the number of stop bits in the receiver, only the transmitter. -- Cheers, Paul B.