#define AD_OE XBYTE[0xBFFF]
#define AD_add XBYTE[0xAFFF]
#define po=P;
unsigned char j;
unsigned char i;
void delay( )
{
int a;
for(a=0;a<3;a++);
}
void interrupt1()interrupt 4 using 2
{
if(RI==1) {RI=0;}
else if(TI==1){;}
}
main()
{
EA=1;
ES=1;
ET1=1;
SCON=0x50;
PCON=0;
TMOD=0x20;
TH1=253;
TL1=253;
TCON=0x40;
while(!TI) {
AD_add=1;
delay();
AD_OE=1;
i=P;
SBUF=i;
}
}
应该是AD采集一次数据,传输给PC后,因为TI为1,循环不能进行,就不会再发数据给PC了 |