TMOD=0x01;ET0=1;EA=1;TH0=(65536-500)/256;TL0=(65536-500)%256;TR0=1;中断程序里再装初值并将P1·0取反即可500个脉冲是1ms
#includevoid main(){ TMOD = 1; TF0 = 1; while(1) { TH0 = 0xFE; TL0 = 0x0C; while(!TF0); TF0 = 0; P1 ^= 1; }}