The block diagram of data transfer between 89c51 microcontroller UART port and personal computer is shown below.
Max232 Level converter
8051(89c51,89c52) Microcontroller UART
Port-1 of our microcontroller is used as output Port. It is connected to data pins of 16×2 lcd.
- Port-3 pin# 5 is connected to rs(regester select) pin of 16×2 lcd.
- Port-3 pin# 6 is connected to en(enable) pin of 16×2 lcd.
- Port-3 pin# 7 is connected to rw(read write) pin of 16×2 lcd.
If you dont know how to interface lcd with 8051(89c51,89c52) microcontroller here are some good tutorial, just go through them.
while(RI==0) is checking RI(receive interrupt) flag continuously. This flag automatically becomes one when 8051(89c51,89c52) receives any data on its RXD pin(P3^0). when RI becomes 1 it means we have one byte of data in our SBUF(serial buffer) register. So in next statement i picked the Byte from SBUF register and save it in character variable data. Then i made the RI flag low again to receive next byte. The Byte which i saved in data variable is now send to display function to be displayed on the 16×2 lcd.