1、 已知单片机的晶振为12M,请以子函数形式写出10毫秒延时程序。该怎...答:软件延时:(asm)晶振12MHZ,延时1秒 程序如下:DELAY:MOV 72H,#100 LOOP3:MOV 71H,#100 LOOP1:MOV 70H,#47 LOOP0:DJNZ 70H,LOOP0 NOP DJNZ 71H,LOOP1 MOV 70H,#46 LOOP2:DJNZ 70H,LOOP2 NOP DJNZ 72H,LOOP3 MOV 70H,#48 LOOP4:DJNZ 70H,LOOP4 定时器延时:晶振12MHZ,延时1s,...
80C51单片机,12mhz.利用中断程序控制8个灯依次亮灭,定时时间为1秒。答:define uint unsigned int unsigned char tab[]={0xfe,0xfc,0xf8,0xf0,0xe0,0xc0,0x80,0x00,0xff};void delay(uint e) //延时函数,延时为0.5s { uint i,j;while(e--){ for(i=0;i<500;i++)for(j=0;j<110;j++);} } void Timer0Init(){ TMOD|=0x01;//选择为定时器0...