最好直接利用定时器延时,定时1毫秒,程序中调用延时函数就行了,Delay(100): uint count; //定义外部变量 Delay( uint k) // 延时函数 { count = k; while(count!=0) ; } TIME0() interrupt 1 // 定时器0中断函数 { TH0 = 0XFC; TL0 = 0X18; count--; }