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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 單片機(jī)可控0-30V可調(diào)電源

          單片機(jī)可控0-30V可調(diào)電源

          作者: 時(shí)間:2016-11-30 來源:網(wǎng)絡(luò) 收藏
          CPU電路圖



          顯示電路


          控制板電路圖


          程序
          #include // 包含型號頭文件

          本文引用地址:http://www.ex-cimer.com/article/201611/324014.htm
          //#include
          #include // 包含"位"操作頭文件
          #include
          #include
          #include
          #include
          #include
          #include

          #define uchar unsigned char
          #define uint unsigned int

          #define TRUE 1
          #define FALSE 0

          #define ad_Temp_flag 0x03 // 溫度轉(zhuǎn)換通道
          #define ad_Vout_flag 0x04 // 電壓轉(zhuǎn)換通道
          #define ad_Iout_flag 0x05 // 電流轉(zhuǎn)換檢測


          #define FAN_ON (PORTB_Bit3 = 1) // FAN 開
          #define FAN_OFF (PORTB_Bit3 = 0) // FAN 關(guān)

          #define D1_ON (PORTA_Bit0 = 0) // D1 開
          #define D1_OFF (PORTA_Bit0 = 1) // D1 關(guān)

          #define D2_ON (PORTA_Bit1 = 0) // D2 開
          #define D2_OFF (PORTA_Bit1 = 1) // D2 關(guān)

          #define D3_ON (PORTA_Bit2 = 0) // D3 開
          #define D3_OFF (PORTA_Bit2 = 1) // D3 關(guān)

          #define D4_ON (PORTB_Bit2 = 0) // D4 開
          #define D4_OFF (PORTB_Bit2 = 1) // D4 關(guān)

          #define D5_ON (PORTA_Bit6 = 0) // D5 開
          #define D5_OFF (PORTA_Bit6 = 1) // D5 關(guān)

          #define D6_ON (PORTA_Bit7 = 0) // D6 開
          #define D6_OFF (PORTA_Bit7 = 1) // D6 關(guān)

          #define DATA164_ON (PORTB_Bit1 = 1) // 74HC164 DATA=1
          #define DATA164_OFF (PORTB_Bit1 = 0) // 74HC164 DATA=0

          #define CLK164_ON (PORTB_Bit0 = 1) //
          #define CLK164_OFF (PORTB_Bit0 = 0) //


          #define Temp_out_lo 0x339 // -5℃ 41.56K
          #define Temp_out_hi 0x10e // 50℃ 3.588K

          uint ad_Temp_result; // 溫度轉(zhuǎn)換結(jié)果
          uint ad_Vout_result; // 電壓轉(zhuǎn)換結(jié)果
          uint ad_Iout_result; // 電流轉(zhuǎn)換結(jié)果

          uint Vout_disp;
          uint Iout_disp;

          uint Iout_adj;

          uchar time_cnt1;
          uchar adc_get_flag;

          //#pragma vector=0x10;
          //__interrupt void TIMER2_OVF_Server(void);

          void mcu_init(void); // I/O初始化,PWM初始化
          void adc_init(void); // ADC初始化
          uint adc_get(uchar adc_ch); // 啟動AD轉(zhuǎn)換,并返回轉(zhuǎn)換值
          void Vout_adc_get(void); // 電壓檢測
          void Temp_adc_get(void); // 溫度檢測
          void Iout_adc_get(void); // 電流檢測
          //數(shù)碼管顯示代碼定義
          __flash uchar disp_led[10] @0x0040 =
          {
          0x0a, // 0
          0x7b, // 1
          0x4c, // 2
          0x58, // 3
          0x39, // 4
          0x98, // 5
          0x88, // 6
          0x5b, // 7
          0x08, // 8
          0x18, // 9
          };
          上一頁 1 2 下一頁

          評論


          技術(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); })();