微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 模拟电路设计 > MAX1233/MAX1234触摸屏控制器入门

MAX1233/MAX1234触摸屏控制器入门

时间:03-17 来源:互联网 点击:

        1. 表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) 测量内部温度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
  • Copyright © 2017-2020 微波EDA网 版权所有

    网站地图

    Top