[microcontroller] What is the difference between baud rate and bit rate?

According to What’s The Difference Between Bit Rate And Baud Rate?:

Bit Rate

The speed of the data is expressed in bits per second (bits/s or bps). The data rate R is a function of the duration of the bit or bit time (TB) (Fig. 1, again):

R = 1/TB

Rate is also called channel capacity C. If the bit time is 10 ns, the data rate equals:

R = 1/10 x 10–9 = 100 million bits/s

This is usually expressed as 100 Mbits/s.

Baud Rate

The term “baud” originates from the French engineer Emile Baudot, who invented the 5-bit teletype code. Baud rate refers to the number of signal or symbol changes that occur per second. A symbol is one of several voltage, frequency, or phase changes.

NRZ binary has two symbols, one for each bit 0 or 1, that represent voltage levels. In this case, the baud or symbol rate is the same as the bit rate. However, it’s possible to have more than two symbols per transmission interval, whereby each symbol represents multiple bits. With more than two symbols, data is transmitted using modulation techniques.

When the transmission medium can’t handle the baseband data, modulation enters the picture. Of course, this is true of wireless. Baseband binary signals can’t be transmitted directly; rather, the data is modulated on to a radio carrier for transmission. Some cable connections even use modulation to increase the data rate, which is referred to as “broadband transmission.”

By using multiple symbols, multiple bits can be transmitted per symbol. For example, if the symbol rate is 4800 baud and each symbol represents two bits, that translates into an overall bit rate of 9600 bits/s. Normally the number of symbols is some power of two. If N is the number of bits per symbol, then the number of required symbols is S = 2^N. Thus, the gross bit rate is:

R = baud rate x log2S = baud rate x 3.32 log10S

If the baud rate is 4800 and there are two bits per symbol, the number of symbols is 2^2 = 4. The bit rate is:

R = 4800 x 3.32 log(4) = 4800 x 2 = 9600 bits/s

If there’s only one bit per symbol, as is the case with binary NRZ, the bit and baud rates remain the same.