Code for reading data from serial interface

Status
Not open for further replies.

armess

Member level 3
Joined
Sep 22, 2006
Messages
64
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,692
how to recode serial port communication data

Can anybody give a code for reading data from a serial device to be processed by an 8051 microcontroller.
 

try to do it urself
 

These are the register value you have to choose for serial communication

SCON = 0X50; Serial port enable and serial mode selection
TMOD = 0x20; Timer1 selection
TH1 = 0xfd; //Baud rate selection here 9600
TR1 = 1;
TI = 1;
 

As aandavan said that is serial mode configuration of receiving the data from hyperterminal via RXd PIN . SBUF is the serial Register of receiving the data from serial end
 

:idea:

just go through mazid book you will get all the related datas regarding 8051 or try ayala
 

It's all explained here:

h**p://www.8052.com/tutser.phtml#Serial%20Mode
 

SCON = 0X50; Serial port enable and serial mode selection
TMOD = 0x20; Timer1 selection
TH1 = 0xfd; //Baud rate selection here 9600
TR1 = 1;
TI = 1;
 

    armess

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…