# 8051 uart problem

Status
Not open for further replies.

#### ulot

##### New Member
Hi,
i have an at89c55wd running at 11.0592MHz, with a UART configured at 9600 baud rate.

I have been noticing some inconsistencies in the code, so when i finally came down to testing the transmit and receive i got found some problems.

if i send a character, it is echoed back correctly, but if i send multiple characters, it seams to miss some. for example if i send "XYZ", it may echo back "XYZ" OR "YZ"

I'm thinking the speed of the MCU is not fast enough for the baud rate, i'm really not sure. I would like some advice.

Thank you.

#### Ian Rogers

##### User Extraordinaire
Forum Supporter
To test your uart take the speed down to 4800 or even 2400 baud to eliminate the uart.. 11.0592mhz will send characters at 9600 very well indeed.

Check you code to ensure the TX buffer is empty before loading a new character (there is a interrupt flag "TI" that need checking then clearing before transmission)

Code:
           MOV S0BUF,A
TXCHAR:    JNB TI.TXCHAR
CLR TI
Ian

Last edited:

#### ulot

##### New Member
Thanks Ian,
i'll try reducing the baud rate.

I do ensure that the TI flag is polled before transmission of any bye and then cleared.

#### ulot

##### New Member
thanks for your help, problem solved.

Status
Not open for further replies.