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.

Problem with baud rates of a 89C51

Status
Not open for further replies.

hayder78

Member level 2
Joined
Mar 2, 2003
Messages
46
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Iraq
Activity points
384
hyperterminal set priority

Hi,

Why does my 89c51 communicate with the pc via serial port very well in speed 9600 bps or less , and any speed over 9600 it will give garbage.

Is there a large tolerance in my 11.059Mhz crystal?
 

Re: bood rate problem

Hi hayder78,

I always used HyperTerminal (on PC side) , when testing comunications with a new RS232 board.

First Check if the Baud Rate is set corectly in HyperTerminal.


If your program still don't work at higher baud rates, you have a probably a software bug

Most probably, you TX/RX bytes without properly check/reset the TI,RI flags.

For example you are not allowed to TX a new byte until the previous byte is not completely sended
 

Re: bood rate problem

It is unlikely that you experience timing problems but it is possible that micros are busy doing something else.
If possible use command-response protocol and/or interrupts. For example, in 51core the serial interrupt is of the lowest priority but you can set priority bit and make it high.
 

Re: bood rate problem

The error is in the hyperterminal when the 8051 send in these bood rates (more than 9600)!!
 

Re: bood rate problem

hayder78 said:
Hi,

Why does my 89c51 communicate with the pc via serial port very well in speed 9600 bps or less , and any speed over 9600 it will give garbage.

Is there a large tolerance in my 11.059Mhz crystal?

A 11,059 crystal oscillator shouldn't have any error (error rate=0), as long as you correctly setup the baudrate in your micro, using correct constant values for the timer.

Are you sure you had made appropriate changes in your flash program ?

If there is no problem with the software, perhaps you should check the quality of your hardware. You should never underestimate NOISE! Using a better PCB does help :)
 

Re: bood rate problem

Make sure that you are set at the same baud rate on both ends. Look at your timing in your code and make sure that you are respecting it. Before you transmit make sure that the receiving end is not busy and is ready to receive more data (use interrupts or polling routine services). On the RX side make sure that all of your data has been received before you start doing something with it.

You may think that these are basic steps and suggestions but major part of the time they are the source of most of the problems with data communication.

After you've checked and made sure that you are respecting all of this, and you are still facing the same problems just blame it on the hardware ;)

hope this helps
s2c97
 

Re: bood rate problem

Surely its due to some initailisation problems.. 8951 is pretty stable at higher baud rates as well.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top