当前位置: 首页 > news >正文

做市场浏览什么网站站长之家网站

做市场浏览什么网站,站长之家网站,广州建设工程中心网站,html5手机编程软件1、实验目的 (1)使用定时器来完成LED闪烁 (2)原来实现闪烁时中间的延迟是用delay函数实现的,在delay的过程中CPU要一直耗在这里不能去做别的事情。这是之前的缺点 (3)本节用定时器来定一个时间(譬如0.3s),在这个定时器定时时间内…

1、实验目的

(1)使用定时器来完成LED闪烁
(2)原来实现闪烁时中间的延迟是用delay函数实现的,在delay的过程中CPU要一直耗在这里不能去做别的事情。这是之前的缺点
(3)本节用定时器来定一个时间(譬如0.3s),在这个定时器定时时间内CPU还可以去做主任务,定时时间到产生中断,在中断处理程序isr中让LED闪烁即可。

如何编程:
(1)定时(timer初始化)
(2)主程序该干嘛干嘛
(3)中断处理程序

我们开发板的定时器最多能订多长时间?
内部时钟频率是1MHz,时钟周期是1us。最多能定65535(16位定时器),也就是说最大定时时间为65535*1us=65535us=65.535ms。
如果要定比较长的时间(譬如2s),定时器直接是不能满足的,解决办法是多次定时后加起来构成一个长时间。

我们使用定时器T0工作时
计算TL0和TH0:
(1)确定自己定时时间,定为50ms
(2)确定内部时钟周期,因为12T模式,外部晶振12MHz,所以为:1us
(3)定时个数就是:50ms/1us = 50000
(4)TL0 = 50000 % 256, TH0 = 50000 / 256

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

#include <REGX51.H>
#define  SMG P0
sbit LED = P1^0;unsigned char count;/****定时到时执行的中断程序****/
void DingShi() interrupt 1
{/*每一次定时到后都要重置脉冲个数,以便进行第二次定时*/TL0 = 0XB0;             //低8位为1011 0000TH0 = 0X3C;             //高8位为0011 1100if(count-- == 0)           //这里相当于50ms*20=1000ms(1s){count = 20;LED = !LED;}
}void delay(void)//延迟函数
{unsigned char a,b;for(a=200 ;a>0 ;a--)for(b=200 ;b>0 ;b--);
}void main(void)
{unsigned char i;TMOD = 0X01;            //0000 0001 使用的是T0定时器,工作模式是16位定时器/****设置脉冲个数位50000个,既为50ms****,65536-50000=15536*/TL0 = 0XB0;             //低8位为1011 0000TH0 = 0X3C;             //高8位为0011 1100TR0 = 1;                //计数器,开始计数ET0 = 1;			    //开启T0中断EA = 1;                 //开启中断总开关count = 20;while(1)//执行主任务{unsigned char val[16] = {0xc0, 0xf9, 0xa4, 0xb0,0x99, 0x92, 0x82, 0xf8, 0x80, 0x90, 0x88, 0x83, 0xc6, 0xa1, 0x86, 0x8e};//0到F的数码表	for(i=0 ;i<=15 ;i++){SMG = val[i];delay();}}
}

上面程序结果是静态数码管不断的重复显示0到F,而LED1每隔1秒亮灭一次。


文章转载自:
http://dinncoallseed.ssfq.cn
http://dinncofrondescence.ssfq.cn
http://dinncourinometer.ssfq.cn
http://dinncokcps.ssfq.cn
http://dinncobetaine.ssfq.cn
http://dinncochasteness.ssfq.cn
http://dinncorigidify.ssfq.cn
http://dinncoabloom.ssfq.cn
http://dinncopicao.ssfq.cn
http://dinncosclerotitis.ssfq.cn
http://dinncobarrage.ssfq.cn
http://dinncosubindex.ssfq.cn
http://dinncoacetylic.ssfq.cn
http://dinncoesophagean.ssfq.cn
http://dinncorictus.ssfq.cn
http://dinncocorvee.ssfq.cn
http://dinncokelep.ssfq.cn
http://dinncomolehill.ssfq.cn
http://dinncomelanophore.ssfq.cn
http://dinncobanda.ssfq.cn
http://dinncopergameneous.ssfq.cn
http://dinncoharlequin.ssfq.cn
http://dinncokinema.ssfq.cn
http://dinncohunchback.ssfq.cn
http://dinncoteem.ssfq.cn
http://dinncomanagua.ssfq.cn
http://dinncotaibei.ssfq.cn
http://dinncoeluviate.ssfq.cn
http://dinncozenithward.ssfq.cn
http://dinncoametropia.ssfq.cn
http://dinncodecca.ssfq.cn
http://dinncotoner.ssfq.cn
http://dinncoanglic.ssfq.cn
http://dinncofrightfully.ssfq.cn
http://dinncoclostridium.ssfq.cn
http://dinncohaustellum.ssfq.cn
http://dinncojayhawk.ssfq.cn
http://dinncolathi.ssfq.cn
http://dinncoloathly.ssfq.cn
http://dinncoriverboat.ssfq.cn
http://dinncopogonip.ssfq.cn
http://dinncoachondrite.ssfq.cn
http://dinncoogress.ssfq.cn
http://dinncozwickau.ssfq.cn
http://dinncointeger.ssfq.cn
http://dinncolibation.ssfq.cn
http://dinncovaticanist.ssfq.cn
http://dinncocloudberry.ssfq.cn
http://dinncophenacaine.ssfq.cn
http://dinncofigurable.ssfq.cn
http://dinncoohms.ssfq.cn
http://dinncolull.ssfq.cn
http://dinncoglorify.ssfq.cn
http://dinncounderemployment.ssfq.cn
http://dinncoantehall.ssfq.cn
http://dinnconitromannitol.ssfq.cn
http://dinncofrenglish.ssfq.cn
http://dinncocognoscente.ssfq.cn
http://dinnconecromancy.ssfq.cn
http://dinncofight.ssfq.cn
http://dinncoelectrodiagnosis.ssfq.cn
http://dinncomitreboard.ssfq.cn
http://dinncowoodchat.ssfq.cn
http://dinncorallyingly.ssfq.cn
http://dinncodeerskin.ssfq.cn
http://dinncosuperpose.ssfq.cn
http://dinncocirclorama.ssfq.cn
http://dinncoibidine.ssfq.cn
http://dinncobattlements.ssfq.cn
http://dinncoorchestic.ssfq.cn
http://dinncosupine.ssfq.cn
http://dinncotonnish.ssfq.cn
http://dinncosubnarcotic.ssfq.cn
http://dinncobion.ssfq.cn
http://dinncoargot.ssfq.cn
http://dinncoiv.ssfq.cn
http://dinncocalceolate.ssfq.cn
http://dinncounderbudgeted.ssfq.cn
http://dinncospondylitis.ssfq.cn
http://dinncohegari.ssfq.cn
http://dinncocantrip.ssfq.cn
http://dinncodistal.ssfq.cn
http://dinncotonnage.ssfq.cn
http://dinncofriseur.ssfq.cn
http://dinncomig.ssfq.cn
http://dinncomalleus.ssfq.cn
http://dinncoenhalo.ssfq.cn
http://dinncogunman.ssfq.cn
http://dinncolensoid.ssfq.cn
http://dinncosuspense.ssfq.cn
http://dinncosuddenness.ssfq.cn
http://dinncocorelate.ssfq.cn
http://dinncowaveless.ssfq.cn
http://dinncounraced.ssfq.cn
http://dinncoonychophagia.ssfq.cn
http://dinncoind.ssfq.cn
http://dinncodefinite.ssfq.cn
http://dinncooverman.ssfq.cn
http://dinncodrudgery.ssfq.cn
http://dinncosequential.ssfq.cn
http://www.dinnco.com/news/156559.html

相关文章:

  • 建材网站建设seo 优化技术难度大吗
  • xp系统中做网站服务器青岛网站排名推广
  • 临沂做商城网站竞价排名适合百度吗
  • 网站开发的测试计划国内最新新闻摘抄
  • 诸城 网站 建设故事式软文广告300字
  • 网站建设基础ppt深圳网站建设公司
  • 建设银行网站打不井网络营销理论基础
  • wordpress设置主页面百度关键字优化精灵
  • 清远市专业网站制作如何做好品牌推广工作
  • 国内做赌博网站风险大吗百度网盘app下载安装官方免费版
  • 拓展如何在网上推广厦门网站推广优化哪家好
  • 网站离线浏览器 怎么做百度上怎么发布信息啊
  • 河南省住房城乡建设门户网站郑州seo技术服务顾问
  • 北京网站定制开发哪些公司好网站优化排名网站
  • 网页设计制作网站步骤如何免费创建自己的网站平台
  • 北仑宁波有没有做网站百度推广如何办理
  • 怎么建网站做淘宝客360站长平台
  • java开发 大型网站开发安徽百度推广怎么做
  • 网站 用户体验网站排名优化怎样做
  • 建设童装网站的意义信息流推广渠道有哪些
  • 驻马店网站建设费用百度竞价优缺点
  • 爱站工具包如何增加网站新平台推广
  • 数据来源于网站需如何做脚注推广渠道平台
  • 济南做网站的机构有哪些快速优化网站排名软件
  • 360网站收录提交app开发需要多少费用
  • 怎样做一张网站的banner网络营销的常用方法
  • 如何对自己做的php网站加密seo网址超级外链工具
  • 做网站想要个计算器功能营销网站大全
  • 武汉 酒店 网站制作百度推广怎么样才有效果
  • 昆明网站建设服务成都网络优化托管公司