TRAIN YOURSELF IN ELECTRONICS
For details about serial communication refer to link 8051 based serial data receiver circuit and code is given below, this simulation will get the data from PCs UART and send its correspondance ASCII code to LEDs attached on port 1. Baud rate is fixed with 9600, how ever one can change its baud rate by changing the value of TH1 (as shown in the table given below).
Working of the circuit
The 8051 consists of Full duplex UART, but it is TTL based UART so a level converter IC MAX232 or equivalent is needed to properly establish a connection with PCs serial port. Pin no 10 of 8051 wich is serial receiver (Rx) pin is connected to PCs transmitter and pin no. 11 of 8051 Transmitter(Tx) is conected to the receiver of PC.
Serial Receiver Code