# 8051 Help with Baud Rate for Serial Tx

Status
Not open for further replies.

#### Frosty_47

##### New Member
Hello,

My lab requires me to set the baud rate to 4800 using 12Mhz crystal. I just don't see how this is possible because 12Mhz/12/32 = 31250 divide that by 4800 and you get 6.5104. How on earth am I supposed program timer 1 with that value?

Unbelivably, this question was on the final exam that I wrote today. The closest value I can get to 4800 Baud with 12Mhz crystal is 5208. Is there something I might have missed in class? Is there some sort of trick for this ?

The only way I know to get 4800 Baud is to use Xtal of 11.0592Mhz...

#### colin mac

##### New Member
If SMOD is set the baud rate is doubled so the formula is
TH1 = 256 - ((system frequency / (12 * 16)) / baud)

So TH1 is loaded with 243.

#### Frosty_47

##### New Member
TY

If SMOD is set the baud rate is doubled so the formula is
TH1 = 256 - ((system frequency / (12 * 16)) / baud)

So TH1 is loaded with 243.
Thanx a lot! I totaly missed the section on "Doubling the baud rate in the 8051" in the txt book. Thanks again for your help!

Status
Not open for further replies.