# What clock frequency for a certain baud rate?

Discussion in 'Embedded Systems and Microcontrollers' started by atferrari, Nov 4, 2011.

1. ### atferrari Thread Starter AAC Fanatic!

Jan 6, 2004
2,611
738
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.

2. ### AlexR Well-Known Member

Jan 16, 2008
735
54
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.

3. ### atferrari Thread Starter AAC Fanatic!

Jan 6, 2004
2,611
738
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.

4. ### ErnieM AAC Fanatic!

Apr 24, 2011
7,323
1,571
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.

Code ( (Unknown Language)):
1. Fosc / ( k * (n+1) )  where K = 64, 16, or 4 depending
2.                       on other settings  (4 for synchronous)
3.
4.                       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).

5. ### AlexR Well-Known Member

Jan 16, 2008
735
54
Yes, in most cases the Tx clock frequency will be the same as the Baud rate.
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.

6. ### MrChips Moderator

Oct 2, 2009
12,234
3,283
I am not a PIC user. Usually, the UART clock is 16 times the baud rate.

7. ### ErnieM AAC Fanatic!

Apr 24, 2011
7,323
1,571
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.

8. ### davebee Well-Known Member

Oct 22, 2008
539
46
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.