What is the use of sbuf in 8051 ?

Status
Not open for further replies.
Re: sbuf in 8051

it is the serial data buffer.
when you want to transmit in serial mode write 8bit data here.
it will get transmitted serially in Txd.

when 8051 receives serial data in Rxd , it assembles and put the 8bit data here for reading.
 
Re: sbuf in 8051

to receive character:
if(RI)
{
byte = SBUF;
RI = 0;
}

to transmit character:

SBUF = byte;
while(!TI):
TI = 0;
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…