You are on page 1of 3

Serial communication in AT89C2051 with labview

By Sandip Nair sandipnair06@yahoo.com sandipnair.hpage.com

Aim: To set up a serial connection between AT89C2051 and PC and test the result. Method: - A Labview interface is developed to control the output of the port 1 of the device using serial port. When simulating the program below in keil, it shows that SBUF data is not read by the processor for the MOV A, SBUF instruction but in actual the hardware does read the data from the SBUF. Program: //program to test the serial interface with AT89C2051 ORG 0x0000; MOV P1, #0x00; //making output of port 1 low MOV IE, #0x90; // enabling global interupt and serial interrupt MOV TMOD, #0x20; //setting timer in auto reload mode i.e. mode2 SETB TR1; //start timer 1 MOV SCON, #0x50; //setting serial in mode 1 and enabling receive MOV TH1, #0xFD; //loading value for 9600 baud rate for timer 1 auto reload L1: SJMP L1; //serial ISR instruction ORG 0x0023; CLR RI; //clearing the RI receive interrupt bit MOV A, SBUF; //moving buffer data to accumulator MOV P1, A; //passing the accumulator data to output RETI; END;

Labview interface: -

Figure1. Labview front panel

Figure2. Block diagram Result: - The above work is shown only to send data from labview over serial port.

You might also like