程序如下:#include/主程序void main() { TMOD=0x00;// 定时器1工作方式0 ET1=1; EA=1; TH1=(8192-5000)/32;TL1=(8192-5000)%32; TR1=1; while(1);}//中断子程序void Timer1() interrupt 3 { TH1=(8192-5000)/32;TL1=(8192-5000)%32; P1^0=~P1^0;}