# What clock frequency for a certain baud rate?

#### atferrari

Joined Jan 6, 2004
3,465
PIC 18F family EUSART

Many years ago I was able to grasp this but I forgot all about it.

For a certain baud rate, how could I know the EUSART's frequency of the clock when transmitting in Synchronized mode?

I understand that I should define if it is 8 or 9 bits/symbol, right? And add if there is parity bit?

Something like Tx clok freq = Baud rate * (8+1)??

If I look at lost on this, yes, I am.

Please, I know the formulas in the datasheet. What I am asking is the relationship between baud rate and Tx clock frequency because I intend use it in non standard way.

Gracias.

#### AlexR

Joined Jan 16, 2008
735
Baud rate is defined as the number of symbols sent or received per second. Unless you are doing some fancy coding the basic symbol is going to be the bit and the Baud rate will be the same as the bit rate. The number of bits per character will effect the number of character per second that you transmit but has no bearing on the actual Baud rate.

#### atferrari

Joined Jan 6, 2004
3,465
Should I understand then that 4960 bauds means a Tx clock of 4960 Hz?

I am looking for that concept: relationship between clock frequency and baud rate.

#### ErnieM

Joined Apr 24, 2011
7,996
Should I understand then that 4960 bauds means a Tx clock of 4960 Hz?

I am looking for that concept: relationship between clock frequency and baud rate.
Baud rate is the symbol rate and is (1 start + 8 data + 1 parity + 1 stop = 11 bits) 1/11th of the bit rate for that case.

Rich (BB code):
Fosc / ( k * (n+1) )  where K = 64, 16, or 4 depending
on other settings  (4 for synchronous)

n = 16 bit value in (SPBRGH, SPBRG)
The data sheet for your particular device should detail all this out.

Full disclosure: I've never understood why the parity (9th bit) does not change the baud rate or the value in (SPBRGH, SPBRG).

#### AlexR

Joined Jan 16, 2008
735
Should I understand then that 4960 bauds means a Tx clock of 4960 Hz?...............
Yes, in most cases the Tx clock frequency will be the same as the Baud rate.
Baud rate is the symbol rate and is (1 start + 8 data + 1 parity + 1 stop = 11 bits) 1/11th of the bit rate for that case.
.....................................

Full disclosure: I've never understood why the parity (9th bit) does not change the baud rate or the value in (SPBRGH, SPBRG).
You are confusing symbol rate with character rate. The term symbol in Baud rate calculations refers to line transitions (in this case to ones and zeros on the line) not to characters so the Baud rate is not effected by the number of bits in each character. The reason the distinction is made between bit rate and symbol rate is that with some forms of modulation a single line transition can represent several data bits. In these circumstances the Baud rate will not be the same as the data rate.

#### MrChips

Joined Oct 2, 2009
19,280
I am not a PIC user. Usually, the UART clock is 16 times the baud rate.

#### ErnieM

Joined Apr 24, 2011
7,996
You are confusing symbol rate with character rate. The term symbol in Baud rate calculations refers to line transitions (in this case to ones and zeros on the line) not to characters so the Baud rate is not effected by the number of bits in each character. The reason the distinction is made between bit rate and symbol rate is that with some forms of modulation a single line transition can represent several data bits. In these circumstances the Baud rate will not be the same as the data rate.
Yes I am confusing them, been decades since I tried to make sense out of that so the bit rate level. Wiki redirects baud rate to symbol rate and defines them as synonymous. Some cobwebs came up with an old confusion, so thanks for clearing that up for me.

Mostly I just set the baud rate to what I need and don't worry about the bit rate.

#### davebee

Joined Oct 22, 2008
539
For transmitting the sending frequency can be the baud rate.

But for receiving, it helps to be able check the line at a greater rate, like 8 or 16 times the expected incoming baudrate.

That's because your goal is to sample the bit values around the center of their pulse. The more finely you can detect the time of the initial shift of the start bit, the more finely you can place the sampling instant near the center of each arriving bit.

So for a general purpose utility, either a discrete UART chip or software that both transmits and receives, the specified driving clock rate will likely be required to be 8 or 16 times the expected incoming baud.