Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[General] Baud Rate issue in UART communication

Status
Not open for further replies.

falcon026

Newbie level 6
Joined
Dec 22, 2014
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
99
i m using at89c5131 @8MHz and i want to communicate via uart ...
but the actual baud rates after calculations are coming to

baud rate | value to be put in TH1 register | TH1 (8bit register)
-------------------------------------------------------------
4800 | 251.659 | 252
9600 | 253.829 | 254
19200 | 254.914 | 255

because of so much difference communication is not perfect ,different characters are received on other end. how to tackle this ?

settings m using:
mode 1 - 8 bit variable baud rate is selected
timer1 in 8-bit auto reload mode
 

19k2 (and even 38k4) with 8 MHz crystal is well possible if you use fast baurate generate mode. You would want to read the at89c5131datasheet.
 

You can achieve the fast (double) baud rate setting by setting PCON register BIT 7 SMOD1.As respected FvM sir suggested data sheet helps you more refer it.
 
dear ud23 !
yeah i did that for 2400 baud rate and got upto 4800
as for 2400 baud rate TH1= 247.3 hence after truncation it comes TH1=247 i.e.

- - - Updated - - -

dear ud23!
yeah i did that earlier but i can go upto 4800 baud rate .. beacuse
for 2400 baud rate TH1= 247.3 , after truncation TH1=247 that generates baud rate 2314 near to 2400 and if we double it by SMOD1 then it is 4628 again near to 4800 so it worked fine ...
but with SMOD1=0 and TH1=252 baud rate is 5208 and with TH1=251 baud rate is 4166 ... and on these baud rates communication is not going on ,
i have tried other baud rates but communication was not successful, only TH1=247 is working fine
 

dear FvM!
if u r referring to SMOD1 methodology then i did that but if there is some other way then please let me know i could not understand via datasheet and 8051 book.
 

thanks FvM actually m still in beginner mode thats y i needed a direction ... thaks alot for ur help ... i have implemented 19200 and 38400 baud rates :) now i m moving on spi , will seek ur help again :)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top