#include
void main ()
{
char x;
P0=0x03;
P1=0x00;
TMOD=TMOD&0x0F;
TMOD=TMOD| 0x20;
TH1=0xFD;
TL1=0xFD;
SCON=0x50;
PCON=PCON|0x80;
TR1=1;
while (1)
{
x=P0&0x03;
switch (x)
{
case 0:
P1=0x00;
break;
case 1:
TI=0;
SBUF='H';
while (TI==0);
TI=0;
SBUF='I';
while (TI==0);
TI=0;
SBUF='!';
while (TI==0);
TI=0;
SBUF= ' ';
while (TI==0);
break;
case 2:
while (RI==0);
P1=SBUF;
RI=0;
break;
case 3:
P1=0xFF;
}
}
}
void main ()
{
char x;
P0=0x03;
P1=0x00;
TMOD=TMOD&0x0F;
TMOD=TMOD| 0x20;
TH1=0xFD;
TL1=0xFD;
SCON=0x50;
PCON=PCON|0x80;
TR1=1;
while (1)
{
x=P0&0x03;
switch (x)
{
case 0:
P1=0x00;
break;
case 1:
TI=0;
SBUF='H';
while (TI==0);
TI=0;
SBUF='I';
while (TI==0);
TI=0;
SBUF='!';
while (TI==0);
TI=0;
SBUF= ' ';
while (TI==0);
break;
case 2:
while (RI==0);
P1=SBUF;
RI=0;
break;
case 3:
P1=0xFF;
}
}
}
Comments
Post a Comment
Thanks for the comment