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

          新聞中心

          PIC16f1937 IO口配置

          作者: 時間:2016-11-18 來源:網(wǎng)絡(luò) 收藏
          配置pic161937為數(shù)字輸入的時候,首先要初使化ANSELx,否則讀為0.

          // Register: ANSELA
          volatile unsigned char ANSELA @ 0x18C;
          // bit and bitfield definitions
          volatile bit ANSA0 @ ((unsigned)&ANSELA*8)+0;
          volatile bit ANSA1 @ ((unsigned)&ANSELA*8)+1;
          volatile bit ANSA2 @ ((unsigned)&ANSELA*8)+2;
          volatile bit ANSA3 @ ((unsigned)&ANSELA*8)+3;
          volatile bit ANSA4 @ ((unsigned)&ANSELA*8)+4;
          volatile bit ANSA5 @ ((unsigned)&ANSELA*8)+5;
          #ifndef _LIB_BUILD
          union {
          struct {
          volatile unsigned ANSA0 : 1;
          volatile unsigned ANSA1 : 1;
          volatile unsigned ANSA2 : 1;
          volatile unsigned ANSA3 : 1;
          volatile unsigned ANSA4 : 1;
          volatile unsigned ANSA5 : 1;
          volatile unsigned : 1;
          volatile unsigned : 1;
          };
          struct {
          volatile unsigned ANSELA : 6;
          };
          } ANSELAbits @ 0x18C;
          #endif

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

          // Register: ANSELB
          volatile unsigned char ANSELB @ 0x18D;
          // bit and bitfield definitions
          volatile bit ANSB0 @ ((unsigned)&ANSELB*8)+0;
          volatile bit ANSB1 @ ((unsigned)&ANSELB*8)+1;
          volatile bit ANSB2 @ ((unsigned)&ANSELB*8)+2;
          volatile bit ANSB3 @ ((unsigned)&ANSELB*8)+3;
          volatile bit ANSB4 @ ((unsigned)&ANSELB*8)+4;
          volatile bit ANSB5 @ ((unsigned)&ANSELB*8)+5;
          #ifndef _LIB_BUILD
          union {
          struct {
          volatile unsigned ANSB0 : 1;
          volatile unsigned ANSB1 : 1;
          volatile unsigned ANSB2 : 1;
          volatile unsigned ANSB3 : 1;
          volatile unsigned ANSB4 : 1;
          volatile unsigned ANSB5 : 1;
          volatile unsigned : 2;
          };
          struct {
          volatile unsigned ANSELB : 6;
          };
          } ANSELBbits @ 0x18D;
          #endif

          // Register: ANSELD
          volatile unsigned char ANSELD @ 0x18F;
          // bit and bitfield definitions
          volatile bit ANSD0 @ ((unsigned)&ANSELD*8)+0;
          volatile bit ANSD1 @ ((unsigned)&ANSELD*8)+1;
          volatile bit ANSD2 @ ((unsigned)&ANSELD*8)+2;
          volatile bit ANSD3 @ ((unsigned)&ANSELD*8)+3;
          volatile bit ANSD4 @ ((unsigned)&ANSELD*8)+4;
          volatile bit ANSD5 @ ((unsigned)&ANSELD*8)+5;
          volatile bit ANSD6 @ ((unsigned)&ANSELD*8)+6;
          volatile bit ANSD7 @ ((unsigned)&ANSELD*8)+7;
          #ifndef _LIB_BUILD
          union {
          struct {
          volatile unsigned ANSD0 : 1;
          volatile unsigned ANSD1 : 1;
          volatile unsigned ANSD2 : 1;
          volatile unsigned ANSD3 : 1;
          volatile unsigned ANSD4 : 1;
          volatile unsigned ANSD5 : 1;
          volatile unsigned ANSD6 : 1;
          volatile unsigned ANSD7 : 1;
          };
          } ANSELDbits @ 0x18F;
          #endif

          // Register: ANSELE
          volatile unsigned char ANSELE @ 0x190;
          // bit and bitfield definitions
          volatile bit ANSE0 @ ((unsigned)&ANSELE*8)+0;
          volatile bit ANSE1 @ ((unsigned)&ANSELE*8)+1;
          volatile bit ANSE2 @ ((unsigned)&ANSELE*8)+2;
          #ifndef _LIB_BUILD
          union {
          struct {
          volatile unsigned ANSE0 : 1;
          volatile unsigned ANSE1 : 1;
          volatile unsigned ANSE2 : 1;
          volatile unsigned : 5;
          };
          struct {
          volatile unsigned ANSELE : 3;
          };
          } ANSELEbits @ 0x190;
          #endif
          // bit and bitfield definitions



          關(guān)鍵詞: PIC16f1937IO口配

          評論


          技術(shù)專區(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); })();