2022年频率测量程序 .pdf





《2022年频率测量程序 .pdf》由会员分享,可在线阅读,更多相关《2022年频率测量程序 .pdf(6页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、/ 信号接入T1 #include #define uint unsigned int #define uchar unsigned char uchar t=0; uint num,tem0,tem1; char lad10=0 xc0,0 xf9,0 xa4,0 xb0,0 x99,0 x92,0 x82,0 xf8,0 x80,0 x98, / 不带小数点的0 到 9 ; / 带小数点的0 到 9 delay0(int k) / 把你的延时函数改为以毫秒计时的一个延时函数,但是一个“非标准的”毫秒 int i,j; for(i=k;i0;i-) /i=xms 即延时约xms 毫秒for(
2、j=110;j0;j-); void t1() interrupt 1 TH0=(65536-50000)/256;/ 为定时器重装初值,定时200us TL0=(65536-50000)%256; t+; void t2() interrupt 3 TH1=0 x00;/ 为定时器重装初值,定时200us TL1=0 x00; fun(int x) P2=0 x01; P0=ladx%10; delay0(2); / 延时函数里面的数要小P0=0 xff; P2=0 x02; P0=lad(x/10)%10; delay0(2); P0=0 xff; P2=0 x04; P0=lad(x/1
3、00)%10; delay0(2); P0=0 xff; P2=0 x08; 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 6 页 - - - - - - - - - P0=ladx/1000; delay0(2); P0=0 xff; void main() TMOD=0 x51;/ 定时器 0 在模式 1 下工作 16 位定时器 ,定时方式定时器 1 在模式1 下工作 16 位计数器,TH0=(65536-50000)/256; TL0=(65536-50000)%
4、256; EA=1; ET1=1; TR1=1; ET0=1; TR0=1; while(1) if(t=20) t=0; tem0 = TH1; / 读数tem1 = TL1; num=tem0*256+tem1; while( 1 ) fun(num); TH1=0 x00;/ 为定时器重装初值,定时200us TL1=0 x00; / 信号接入T1 #include #define uint unsigned int #define uchar unsigned char uchar t=0; 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - -
5、- - - - - 名师精心整理 - - - - - - - 第 2 页,共 6 页 - - - - - - - - - uint num,tem0,tem1; char lad10=0 xc0,0 xf9,0 xa4,0 xb0,0 x99,0 x92,0 x82,0 xf8,0 x80,0 x98, / 不带小数点的0 到 9 ; / 带小数点的0 到 9 delay0(int k) / 把你的延时函数改为以毫秒计时的一个延时函数,但是一个“非标准的”毫秒 int i,j; for(i=k;i0;i-) /i=xms 即延时约xms 毫秒for(j=110;j0;j-); void t1(
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022年频率测量程序 2022 频率 测量 程序

限制150内