...请以子函数形式写出10毫秒延时程序。该怎么写啊?用C语言写。_百度...答:软件延时:(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,...
51单片机中用定时器怎么样控制频率答:include<intrins.h> define uint unsigned int //宏定义 define uchar unsigned char //宏定义 sbit beep=P2^3;uchar num=0,times=0;uint flag,tt;uint freq[]={4000,400,80,40,20,10,5,4}; //1Hz~1KHz void main() //主函数 { beep=0;TMOD=0x12;//设置定时器0,定时器...