# Baud to bit mapping for the UART?

Before starting the question, a reminder of the difference between on how a baud rate and a bit rate relate.

Two people are standing 1km apart and they want to exchange a 8 bits of data. Beforehand they decided that each will be given flags that have digits from 0-3 printed on them. They also agreed that they will change the flag every 1 second. They also agreed on the following symbol to bit mapping:

0 - 00

1 - 01

2 - 10

3 - 11

They will be exchanging the information at a rate of 1 symbol per second. The baud rate is 1 symbol per second. The bit rate is 2 because one symbol carries 2 bits of information.

To connect to a serial console of an embedded device we physically connect the device with a cable similar to this one. After specifying the correct baud rate we get a terminal and are able to communicate with the device through our PC.

My question is whether there is a standard UART mapping between the symbols and the bits?

Is the UART symbol to bit mapping a one on one relation? Voltage level low -> 0 Voltage level high -> 1?

If not, what kind of carrier for bits is used?

• In case of regular UART, symbol=bit. See here (which is a possible duplicate) – Eugene Sh. Apr 13 '17 at 17:42
• Well actually in information theory a bit is a bit of INFORMATION, I can send eight data bits and only send one information bit. That said, on a UART a data baud = a data bit because there are only two voltages per symbol – Claudio Avi Chami Apr 13 '17 at 17:42
• @EugeneSh. I seem to have made an error by asking the mapping for for the UART. It doesn't deal with how the bits are mapped to the carrier. Will try and rephrase. – TheMeaningfulEngineer Apr 13 '17 at 17:51

The UART used in a PC COM port doesn't carry out modulation as such, that would only happen when you send the serial data through something like a modem or radio link where it has to be converted into an audio signal in the range carried by a telephone line or used to modulate a carrier wave.

The "mapping" is defined by the interface standard; in the case of RS-232, anything less than -3V is considered a logic 1 and anything greater than +3V a logic 0.

• So it is only sensible to talk about bitrates when talking about a UART. – TheMeaningfulEngineer Apr 13 '17 at 22:05
• I've yet to find an engineer that really cared whether it was referred to as baud rate or bit rate. Just one senior manager who made a point of tutting loudly and changing "baud" to "bps" whenever he saw it in a document. We always knew what was really going on at the nuts and bolts level. With the UART, that is, what was going on with the manager was always a mystery... – Finbarr Apr 14 '17 at 13:13

Unfortunately there is no really good term. RS-232 is incorrectly used often to describe this interface I guess UART is about as good as we have. As far as the payload, the data itself, one symbol is one bit.

You can simply look up UART at wikipedia.

As far as the TTL levels go the line is idle high. A start bit is one bit period long and is low, telling the receiver some data is coming, the next some number of bits agreed upon both sides, say 7 or 8 bits is very common come next least significant bit first. One bit cell per bit. So if you want to send the byte 0x53 the next bits would be 11001010. And then at least one stop bit, high or sometimes two. Start, payload, stop. If you didnt have another character to send then you just left the line high.

Other options are parity, even, odd, or non (no bit sent). So 8N1 is pretty common, 8 bits no parity one stop bit. Parity is computed across the payload, the data bits, not the start and stop.

In order to send it from computer to computer that is where RS-232 comes in it defines the voltages levels and pins, a one is something less than -3Volts to -15Volts a zero is +3 volts to +15. You take the TTL level signals and send them through a transceiver and then into a common connector to make it a COM or SERIAL port on a PC for example.

Baud and bitrate are related if you are using 9600 baud it is 9600Hz, each bit cell is 1/9600 or 0.000104...seconds or 9600 bit cells per second, but they didnt want to say bits per second, because one it is not necesarily continous and you have some extra bit cells the start, parity and stop bits that are not data bits. So at 9600 baud if you were running 8N1 that is 10 bit cells per character or byte if going as fast as possible or 960 chracters per second, 7680 data bits per second. 9600 8E1 is different though a little slower 11 bits cells per character not 10.

RS-232C, RS-485, RS-422 are different electrical standards for describing the voltage levels on the bits as well as either connector or pins or other, for example using a differential pair, one side of the pair is the low voltage for a one while the other signal in that pair would be the opposite. Can get cleaner/longer runs that way, the receiver measures the difference between them one relative to the other rather than one signal relative to a common ground, to extract the one or zero state. RS-422 can send uart data as can RS-232 it doesnt define the start/stop/data nature of the bit stream it just describes the voltage levels pins and wiring.

When you take an arduino or a raspberry pi for example, these have uarts, but they are not RS-232 you would destroy the chips if you hooked them up to RS-232, they are ttl level 5.0V or 3.3v with a zero being ground and a one being high, you can for a couple bucks or less buy usb to uart devices based on FTDI chips and others that can be treated the same way as a com/serial port on an older computer was, windows, linux, etc see them as com/tty ports and you can use the same software but they are not RS-232 they are just TTL level uart and you can wire them directly to your arduino or raspberry or other microcontroller or processor if you use the right voltage levels and are safe with your ground reference.

There are two things going on here.

First, the physical layer: "UART" serial devices of the sort you're talking about all use some sort of high/low voltage to indicate marks and spaces. RS-232 uses +/-12V; TTL serial often uses 0/3.3V, or sometimes other voltages depending on the system. In any event, there's one bit per time period -- this isn't a complex multi-level system of the sort your quote alludes to.

Second, baud rate versus bit rate. Conventionally, most serial links will send each byte of data as one start bit (always low), eight data bits, and one stop bit (always high). The start/stop bits count towards baud rate (because they take time to transmit), but not as part of the bit rate (because they're not data). As such, a 9600 baud link has a bit rate of 7680 bits per second (9600 x 8 ÷ 10).

The answers have addressed my questions correctly stated that for UART the bits are mapped to the symbol in a one-on-one fashion.

Regardless of the TTL, RS232 or RS422 there is always just two symbols representing two binary bits.

The answers seem to stick to the following terminology when addressing baud rate and bit rate for UART:

• bitrate -> bitrate of the data payload
• baudrate -> bitrate of both data payload and the protocol overhead

I found this to be a big source of confusion and am much more fond of the following definitions:

• baudrate - number of physical symbols per second
• bitrate - number of bits per second without any data/protocol overhead implications

Given there is 1bit per symbol for UART, I feel the whole notion of the baud rate in UART should not be unnecessary introduced. Not that the concept doesn't exist but it provides little practical significance and introduces confusion.

I find that talking abut baud rate makes sense in situations where the physical modulations schemes carry more bits per symbol.

• Too late. It's been called "baudrate" for decades. Changing it is impossible, like the conventional current/electron current confusion. – pjc50 Apr 14 '17 at 9:18
• @pjc50 Fair :) But will extend the definition when explaining it to someone, for it seem to have grown to cover two things. It made me go through a lot of confusion – TheMeaningfulEngineer Apr 14 '17 at 9:22
• On the wire, the bit rate is indeed the total number of bits per second being transferred, including overhead. If you want to differentiate, you can use information rate and then you won't clash with standard usage :) – Peter Smith Apr 14 '17 at 14:30