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

          新聞中心

          EEPW首頁 > 模擬技術 > 設計應用 > MAX1233/MAX1234觸摸屏控制器入門

          MAX1233/MAX1234觸摸屏控制器入門

          作者: 時間:2012-03-17 來源:網(wǎng)絡 收藏
          E cellSpacing=1 cellPadding=2 border=0>
          DEMO1234 Command
          Action
          SPI data in
          (3.3V) (5.0V)
          T W DD FF
          DACOUT = full-scale
          0x000b 0x00ff
          DACOUT = 2.96VDACOUT = 4.48V
          T W DD 00
          DACOUT = 0V
          0x000b 0x0000
          DACOUT = 0.0VDACOUT = 0.0V
          T W DD 80
          DACOUT = mid-scale
          0x000b 0x0080
          DACOUT = 1.485VDACOUT = 2.25V
          T W DC 8000
          Disable DAC
          0x0042 0x8000
          DACOUT = 0.0VDACOUT = 0.0V
          T W DC 0
          Enable DAC
          0x0042 0x0000
          DACOUT = 1.485VDACOUT = 2.25V

          2.2) 選擇ADC基準電源模式

          ADC需要一個基準電壓。對于典型的嵌入式系統(tǒng)工作,默認設置是fine。在自動上電模式(ADC3210 = 0000,RES10 = 00)下,/提供自己的內(nèi)部基準電壓。在每次測量之前,內(nèi)部基準自動上電,測量完成后關斷。

          對于第一次診斷,保持上電模式(ADC3210 = 0000,RES10 = 01)支持使用手持式DVM對基準電壓進行外部驗證。

          ADC掃描選擇位設置為0000,寫入ADC控制寄存器(0x40),來設置ADC基準電源模式。RES1/RES0位選擇基準電源模式,基準控制位RFV選擇內(nèi)部1.0V或者2.5V基準(請參考/數(shù)據(jù)資料的表13)。

          ADC控制字:x x 0 0 0 0 RES1 RES0 x x x x x x x RFV

          表4. 內(nèi)部基準命令
          DEMO1234 Command
          Action
          SPI data in
          Verification
          T W AC 0100
          Internal 1V reference always powered; write ADC control word with
          ADC3210 = 0000,
          RES10 = 01,
          RFV = 0
          0x0040 0x0100
          Voltage at pin 12 REF is between 0.98V and 1.02V
          T W AC 0101
          Internal 2.5V reference always powered; write ADC control word with
          ADC3210 = 0000,
          RES10 = 01,
          RFV = 1
          0x0040 0x0101
          Voltage at pin 12 REF is between 2.47V and 2.53V
          T W AC 0001
          Internal 2.5V reference powered when needed; write ADC control word with
          ADC3210 = 0000,
          RES10 = 00,
          RFV = 1
          0x0040 0x0001
          Voltage at pin 12 REF will be powered only briefly as necessary

          表5. 外部基準命令
          DEMO1234 Command
          Action
          SPI data in
          T W AC 0300
          External reference must be provided;
          ADC_control_wr_demand_scan:(write)demand scan
          ADC_control_AD0000:configure reference
          ADC_control_RES11:external reference
          0x0040 0x0300

          2.3) 測量外部電壓輸入AUX1和AUX2

          表6. ADC測量命令序列
          DEMO1234 Command
          Action (Triggered by A/D3210 Bits)
          SPI data in
          T M8
          Measure AUX1 with 12-bit resolution and 3.5μs conversion rate
          0x0040 0x2301

          0x8007 0x0000
          T W AC 2301
          Trigger ADC scan of AUX1;
          ADC control word 0x2301 means:
          ADC_control_wr_demand_scan
          ADC_control_AD1000 /* measure AUX1 */
          ADC_control_RES11 /* 12-bit resolution */
          ADC_control_AVG00 /* no averaging */
          ADC_control_CNR00 /* conversion rate 3.5μs */
          ADC_control_RFV /* RFV=1: VREF=2.5V */
          0x0040 0x2301
          T R A1
          Read AUX1 result AUX1_code
          0x8007 0x0000
          T M9
          Measure AUX2 with 12-bit resolution and 3.5μs conversion rate
          0x0040 0x2701

          0x8008 0x0000

          2.4) 將AUX1和AUX2轉換結果譯為物理值

          下面的C/C++偽代碼片斷總結了DEMO1234程序是怎樣解釋AUX1和AUX2轉換結果的。
              /* ADC control resolution value selects num_codes 4096 (12-bit), 1024 (10-bit), or 256 (8-bit) */int num_codes = 4096; /* ADC_control_RES11: 12-bit resolution *//* Voltage that corresponds to the full-scale ADC code; may be internal 1V or 2.5V ref, or ext ref. */double ADC_fullscale_voltage = 2.5; /* ADC_control_RFV=1: VREF=2.5V.  RFV=0: VREF=1.0V. *//* AUX1_code is the 16-bit result read by SPI command 0x8007 */double AUX1_Voltage = (AUX1_code * ADC_fullscale_voltage) / num_codes;/* AUX2_code is the 16-bit result read by SPI command 0x8008 */double AUX2_Voltage = (AUX2_code * ADC_fullscale_voltage) / num_codes;

          2.5) 測量外部電壓輸入BAT1和BAT2

          表7. ADC測量命令序列
          DEMO1234 Command
          Action (Triggered by A/D3210 Bits)
          SPI data in
          T M6
          Measure BAT1 with 12-bit resolution and 3.5μs conversion rate
          0x0040 0x1b01

          0x8005 0x0000
          T W AC 1b01
          Trigger ADC scan of BAT1;
          ADC control word 0x1b01 means:
          ADC_control_wr_demand_scan
          ADC_control_AD0110 /* measure BAT1 */
          ADC_control_RES11 /* 12-bit resolution */
          ADC_control_AVG00 /* no averaging */
          ADC_control_CNR00 /* conversion rate 3.5μs */
          ADC_control_RFV /* RFV=1: VREF=2.5V */
          0x0040 0x1b01
          T R B1
          Read BAT1 result BAT1_code
          0x8005 0x0000
          T W AC 1b21
          Trigger ADC scan of BAT1;
          ADC control word 0x1b21 means:
          ADC_control_wr_demand_scan
          ADC_control_AD0110 /* measure BAT1 */
          ADC_control_RES11 /* 12-bit resolution */
          ADC_control_AVG00 /* no averaging */
          ADC_control_CNR10 /* conversion rate 10μs */
          ADC_control_RFV /* RFV=1: VREF=2.5V */
          0x0040 0x1b21
          T R B1
          Read BAT1 result BAT1_code
          0x8005 0x0000
          T M7
          Measure BAT2 with 12-bit resolution and 3.5μs conversion rate
          0x0040 0x1f01

          0x8006 0x0000

          2.6) 將BAT1和BAT2轉換結果譯為物理值

          下面的C/C++偽代碼片斷總結了DEMO1234程序是怎樣解釋BAT1和BAT2轉換結果的。注意:通過一個4:1輸入分配器來測量BAT1和BAT2。
              /* ADC control resolution value selects num_codes 4096 (12-bit), 1024 (10-bit), or 256 (8-bit) */int num_codes = 4096; /* ADC_control_RES11: 12-bit resolution *//* Voltage that corresponds to the full-scale ADC code; may be internal 1V or 2.5V ref, or ext ref. */double ADC_fullscale_voltage = 2.5; /* ADC_control_RFV=1: VREF=2.5V.  RFV=0: VREF=1.0V. *//* Note: BAT1 and BAT2 measure through a 4:1 input divider. *//* BAT1_code is the 16-bit result read by SPI command 0x8005 */double BAT1_Voltage = 4 * (BAT1_code * ADC_fullscale_voltage) / num_codes;/* BAT2_code is the 16-bit result read by SPI command 0x8006 */double BAT2_Voltage = 4 * (BAT2_code * ADC_fullscale_voltage) / num_codes;

          2.7) 測量內(nèi)部溫度TEMP1和TEMP2

          表8. ADC測量命令序列
          DEMO1234 Command
          Action (Triggered by A/D3210 Bits)
          SPI data in
          T MA
          Measure TEMP1 with 12-bit resolution and 3.5μs conversion rate
          0x0040 0x2b01

          0x8009 0x0000
          T W AC 2b01
          Trigger ADC scan of TEMP1;
          ADC control word 0x2b01 means:
          ADC_control_wr_demand_scan
          ADC_control_ AD1010 /* measure TEMP1 */
          ADC_control_RES11 /* 12-bit resolution */
          ADC_control_AVG00 /* no averaging */
          ADC_control_CNR00 /* conversion rate 3.5μs */
          ADC_control_RFV /* RFV=1: VREF=2.5V */
          0x0040 0x2b01
          T R T1
          Read TEMP1 result TEMP1 _code
          0x8009 0x0000
          T MC
          Measure TEMP1, TEMP2 with 12-bit resolution and 3.5μs conversion rate
          0x0040 0x3301

          0x8009 0x0000

          0x800a 0x0000
          T W AC 3301
          Trigger ADC scan of TEMP1 and TEMP2;
          ADC control word 0x3301 means:
          ADC_control_wr_demand_scan
          ADC_control_ AD

          評論


          相關推薦

          技術專區(qū)

          看屁屁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); })();