You have no items in your shopping cart.

Subtotal: 0.00

How to Interface UART with 8051 Lab Trainer Kit

8051B - TRAINER BOARD

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.

 

INTERFACING UART

Fig. 1 shows how to interface the UART to microcontroller. To communicate over UART or USART, we just need three basic signals which are namely, RXD (receive), TXD (transmit), GND (common ground). So to interface UART with 8051, we just need the basic signals.

Fig. 1 Interfacing UART to Microcontroller

INTERFACING UART WITH 8051

We now want to display a text in PC from 8051 Trainer Board by using UART module. In 8051Trainer 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

 

 

UART DB-9 Connector

8051

Processor Lines

Serial Port Section

UART0(P0)

ISP PGM

TXD-0

P3.0

         

RXD-0

P3.1

 

 

CIRCUIT DIAGRAM TO INTERFACE UART WITH 8051


ASSEMBLY PROGRAM TO DISPLAY A TEXT IN PC FROM 8051

*****************************************************************************************************************

Title : Program to display a text in PC from 8051 through UART0

*****************************************************************************************************************

 

MEMORY ADDRESS

OPCODE

MNEMONICS

8500

75,89,21

MOV TMOD,#21

8503

75 8D FD

MOV TH1,#FD

 8506

75 98 52

MOV SCON,#52

8509

D2 8E

SETB TR1

850B

74 41

H:MOV A,#41

850D

B1 11

ACALL TXMT

850F

80 FA

SJMP H

8511

30 99 FD

TXMT:JNB TI,TXMT

8514 

C2 99

CLR TI

8516

F5 99

MOV SBUF,A

8518

22

RET