#include <AT89X51.H>
unsigned int TD3=0;
void t0(void) interrupt 1 using 3 { TH0=(65536-50000)/256; TL0=(65536-50000)%256; TD3++; }
void main() { unsigned int buf; //////////增加的变量 TMOD=0x11; TH0=(65536-50000)/256; TL0=(65536-50000)%256; ET0=1; EA=1; TR0=1; buf = 0x00; while(buf < 18000) //////更改的部分 { do { buf = TD3; }while(buf != TD3); } TD3=0; } |