You are currently viewing How to Interface UART with 8051 Lab Trainer Kit

How to Interface UART with 8051 Lab Trainer Kit

Spread the love

This blog post summarize how to interface UART with 8051 using assembly programming

PS-TRAINER-8051 trainer kit is proposed to smooth the progress of learning and developing designs of MCU from Intel and NXP. It has the facility to connect PC’s 101/104 Keyboard, to enter user programs in Assembly languages. Serial communication achieved using 8051. It also supports C & assembly language in standalone kit (P89V51RD2). It’s designed as to facilitate On-board Programmer for NXP 8051 MCU through ISP on serial port.

UART

UART (Universal Asynchronous Receiver Transmitter) are one of the basic interfaces which provide a cost effective simple and reliable communication between one controller to another controller or between a controller and PC.

Rs-232 level converter

Usually all the digital ICs work on TTL or CMOS voltage levels which cannot be used to communicate over RS-232 protocol. So a voltage or level converter is needed which can convert TTL to RS232 and RS232 to TTL voltage levels. The most commonly used RS-232 level converter is MAX232.

This IC includes charge pump which can generate RS232 voltage levels (-10V and +10V) from 5V power supply. It also includes two receiver and two transmitters and is capable of full-duplex UART/USART communication.

  • RS-232 communication enables point-to-point data transfer. It is commonly used in data acquisition applications, for the transfer of data between the microcontroller and a PC.
  • The voltage levels of a microcontroller and PC are not directly compatible with those of RS-232, a level transition buffer such as MAX232 be used.

Interface UART

 Interface UART with 8051
Fig. 1 Interfacing UART to Microcontroller

Interface UART with 8051

We now want to display a text in PC from 8051 Trainer Board by using UART module. In 8051 Trainer Board contains two serial interfaces that are UART0 & UART1. Here we are using UART0. The Transmitter pins send the data into PC and the receiver pin receives the data from PC. The PC and microcontroller speed are denoted by using baud rate. When the baud rates of both PC and Microcontroller are same, then only the data transmit and receive correctly otherwise not.

Pin assignment with 8051

How to Interface UART with 8051 Lab Trainer Kit

Circuit diagram to interface UART with 8051

How to Interface UART with 8051 Lab Trainer Kit

Assembly program to interface UART with 8051

MEMORY ADDRESSOPCODEMNEMONICS
850075,89,21MOV TMOD,#21
850375 8D FDMOV TH1,#FD
 850675 98 52MOV SCON,#52
8509D2 8ESETB TR1
850B74 41H:MOV A,#41
850DB1 11ACALL TXMT
850F80 FASJMP H
851130 99 FDTXMT:JNB TI,TXMT
8514 C2 99CLR TI
8516F5 99MOV SBUF,A
851822RET

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.