为什么串口不能接收
以下是我的程序,您帮我看看行吗?
#include <reg51.h>
unsigned char ch;
void ser ()interrupt 4
{
if (ri==1)
{
ri=0;
rb8=1;
ch=sbuf;
sbuf=ch;
if(ti!=0){
ti=0;
}
}
}
/////////////////////////////////////////
main()
{
tmod=0x20;
tl1=0xfd;
th1=0xfd;
scon=0xd8;///////////11011000
pcon=0x00;
tr1=1;
}
发表时间:2003年4月22日5:31:05