在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

    
    
    <address id="vxupu"><td id="vxupu"></td></address>

      <pre id="vxupu"><small id="vxupu"></small></pre>
      <dfn id="vxupu"></dfn>
      <div id="vxupu"><small id="vxupu"></small></div>
    1. 新聞中心

      EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 99秒計(jì)時(shí)+99秒倒計(jì)時(shí)(中斷觸發(fā)定時(shí)器)

      99秒計(jì)時(shí)+99秒倒計(jì)時(shí)(中斷觸發(fā)定時(shí)器)

      作者: 時(shí)間:2012-09-04 來源:網(wǎng)絡(luò) 收藏

      主函數(shù)中的關(guān)于的控制位:

      TMOD |=0x01; //模式選擇
      TH0=0xd8; //高8位
      TL0=0xf0; //低8位
      IE= 0x82; //打開
      TR0=1; //打開定時(shí)開關(guān)(運(yùn)行控制位,置“1”啟動(dòng)0)

      TMOD |= 0x01; //使用模式1,16位定時(shí)器
      TH0=0x00;
      TL0=0x00;
      EA=1; //總打開
      ET0=1; //定時(shí)器中斷打開
      TR0=1; //定時(shí)器開關(guān)打開


      */

      ______________________________________________

      功能:99秒

      時(shí)間:2010—7—18

      ______________________________________________


      #includereg52.h>


      code unsigned char tab[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};

      unsigned char Dis_Shiwei;
      unsigned char Dis_Gewei;

      void delay(unsigned int cnt)
      {
      while(--cnt);
      }

      main()
      {

      TMOD |=0x01; //10ms in 12M crystal
      TH0=0xd8;
      TL0=0xf0;
      IE= 0x82;
      TR0=1;

      while(1)
      {
      P0=Dis_Shiwei;
      P2=0;
      delay(300);
      P0=Dis_Gewei;
      P2=1;
      delay(300);
      }

      }

      void tim(void) interrupt 1 using 1
      {
      static unsigned char second=99,count;
      TH0=0xd8;
      TL0=0xf0;
      count++;
      if (count==100)
      {
      count=0;
      second--;
      if(second==0)
      {
      second=99;
      }
      Dis_Shiwei=tab[second/10];
      Dis_Gewei=tab[second%10];

      }
      }

      紅外遙控器相關(guān)文章:紅外遙控器原理

      上一頁 1 2 下一頁

      評(píng)論


      相關(guān)推薦

      技術(shù)專區(qū)

      關(guān)閉