ZHCAFX9 August   2025 HDC1010 , HDC1080 , HDC2010 , HDC2021 , HDC2022 , HDC2080 , HDC3020 , HDC3020-Q1 , HDC3021 , HDC3021-Q1 , HDC3022 , HDC3022-Q1 , HDC3120

 

  1.   1
  2.   摘要
  3.   商标
  4. 1简介
  5. 2数字 I2C 接口概述
    1. 2.1 寄存器映射协议
      1. 2.1.1 I2C 寄存器映射协议的快速概览
        1. 2.1.1.1 HDC1x
        2. 2.1.1.2 HDC2x
          1. 2.1.1.2.1 按需触发模式下的连接
          2. 2.1.1.2.2 使用自动测量模式 (AMM) 连接
    2. 2.2 命令协议
      1. 2.2.1 HDC302x
        1. 2.2.1.1 按需触发模式下的连接(单次触发)
        2. 2.2.1.2 自动测量模式 (AMM) 下连接
        3.       如何使用 CRC 校验测量数据
  6. 3模拟接口概述
    1. 3.1 HDC3120
  7. 4总结
  8. 5开发支持和文档
    1. 5.1 软件支持
    2. 5.2 参考资料

自动测量模式 (AMM) 下连接

本节概述了如何为 AMM 配置 HDC302x,并说明了与按需触发模式相比的主要差异。

自动测量模式和按需触发之间的主要区别在于:如果用户想要以固定间隔从 HDC302x 传感器读取数据,则自动测量模式更适合其可编程输出间隔。图 2-8 显示了对 HDC302x 进行编程的命令序列,每秒输出一次测量,具有较低噪声和较高可重复性。

 HDC302x 自动测量模式 (AMM) 通信结构图 2-8 HDC302x 自动测量模式 (AMM) 通信结构
// configure HDC302x for Auto Measurement Mode (1 measurement/sec)
// lowest noise, highest repeatability 
void deviceInit() {

    Wire.beginTransmission(0x44);
    Wire.write(0x21); //send MSB of command
    Wire.write(0x30); //command LSB
    Wire.endTransmission();
    delay(15); //wait 15ms before reading

}

在器件配置为自动测量模式并且经过足够的时间来完成转换(本例中为一秒)后,使用以下函数来请求存储的测量数据:

// Helper function for requesting data when in Auto Measurement Mode
void requestData() {

    Wire.beginTransmission(DEVICE_ADDR); // initiate communication
    Wire.write(0xE0); // send MSB of read command
    Wire.write(0x00); // send LSB of read command
    Wire.endTransmission();

}

若要在 AMM 中持续轮询器件,您可以发出读取命令以在配置的采样率(每秒测量次数)下检索最新的测量数据。

此处的 TI GitHub™ 环境传感器存储库提供了演示 HDC302x 在 AMM 中的工作的完整 Arduino 示例——包括器件配置、测量轮询和数据读数。