Write a program for serial tranmission.


#include<8051.h>
void transmission(unsigned char a);
void trans_init();
void delay(unsigned int i)
{
while(i!=0);
{
i–;
}
}
void trans_init()
{
TMOD=0x20;
SCON=0x40;
TH1=0xfd;
TR1=1;
}
void transmission(unsigned char a)
{
SBUF=a;
delay(500);
TI=0;
}
void main()
{
trans_init();
while(1)
{
delay(0xffff);
transmission(‘a’);
transmission(‘b’);
transmission(‘c’);
}
}

Add Comment