8051 mode0 serial trans problem

Status
Not open for further replies.

rameshrai

Full Member level 3
hi,

i am trying to use the mode 0 serial transmission mode of 8051 microcontroller but it is not working.

what value of SCON register must be placed in order to use it?

i have used
scon = 0x00;

is this correct?

thanks

SCON=0x00 ok
for send data
TI=1;
SBUF=(data);
TI=1;
while(TI==0);
TI=0;
TI=0

rameshrai

Full Member level 3
the code is not working i only get the clock signal but not the data.

why there is TI=1 two times and TI =0 two times?

Code:
#include <reg51.h>

void main(void)
{
SCON=0x00;
TI=1;
while(1)
{
SBUF=0x05;
TI=1;
while(TI==0);
TI=0;
TI=0;
}

}

thanks

arun_190175

Member level 3
test it i think solve your problam
and sorry for last post

- - - Updated - - -

Attachments

• 8051_mode0.rar
35.4 KB · Views: 3

rameshrai

Full Member level 3
it is not working

arun_190175

Member level 3
why check with simulation this is tested with real hardware

rameshrai

Points: 2