Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.
 
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:
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.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top