<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 串行數(shù)據(jù)轉(zhuǎn)換成并行數(shù)據(jù)

          串行數(shù)據(jù)轉(zhuǎn)換成并行數(shù)據(jù)

          作者: 時(shí)間:2016-11-17 來(lái)源:網(wǎng)絡(luò) 收藏
          C代碼:

          本文引用地址:http://www.ex-cimer.com/article/201611/315525.htm

          #include // 包含頭文件
          sbit HC164_data = P3^0; // 端口引腳定義。,數(shù)據(jù)輸出端,
          sbit HC164_CLK = P3^1; //時(shí)鐘輸出端
          // 延時(shí)函數(shù)
          void delay(void)
          {
          unsigned int i,j;
          for(i=0;i<1000;i++)
          {
          for(j = 0;j < 500;j++);
          }
          }
          // 主函數(shù)
          void main(void)
          {
          unsigned char i;
          P3 = 0x00;
          for(i = 0;i < 8;i++) //
          {
          HC164_data = 1 << i; // 數(shù)據(jù)串行輸出,一次移動(dòng)一位
          HC164_CLK = 1; // 數(shù)據(jù)在上升沿期間輸出
          HC164_CLK = 0; //
          delay();
          }
          while(1)
          {
          }
          }

          仿真原理圖:



          評(píng)論


          技術(shù)專(zhuān)區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();