HDC1080

HDC1080 is a Temperature and Humidity Sensor IC (-40°C~+125°C、0.0%RH~100.0%RH) made by Texas Instruments. This posting will provide the OSS-ECAL(Open Source Software for Electronic Components Abstraction Layer) for HDC1080.
MCU interface : I2C,

CAUTION:Please be sure to refer to the latest version of the Datasheet prior to actual design.

HDC1080

General description

The HDC1080 is a digital humidity sensor with integrated temperature sensor that provides excellent measurement accuracy at very low power. The HDC1080 operates over a wide supply range, and is a low cost, low power alternative to competitive solutions in a wide range of common applications. The humidity and temperature sensors are factory calibrated.

Feature

  • Relative Humidity Accuracy ±2% (typical)
  • Temperature Accuracy ±0.2°C (typical)
  • Excellent Stability at High Humidity
  • 14 Bit Measurement Resolution
  • 100 nA Sleep Mode Current
  • Average Supply Current:
    710 nA @ 1sps, 11 bit RH Measurement
    1.3 µA @ 1sps, 11 bit RH and Temperature Measurement
  • Supply Voltage 2.7 V to 5.5 V
  • Small 3 mm x 3 mm Device Footprint
  • I2C Interface

Application

  • HVAC
  • Smart Thermostats and Room Monitors
  • White Goods
  • Printers
  • Handheld Meters
  • Medical Devices
  • Wireless Sensor (TIDA: 003740048400524)

OSS-ECAL specification

API Function

etSTS oHDC1080( etCMD cmd, uint16 cfg, stHDC1080_O* rlt )

The oHDC1080 function is an API function that executes HDC1080 processing according to the command in the argument.

NOTE:
The measurement time is as follows. (Decimal places less than 1 ms are rounded up)
Temperature: 11bit conversion 3.65ms, 14bit conversion 6.35ms
Humidity: 8bit conversion 2.50ms, 11bit conversion 3.65ms, 14bit conversion 6.5ms
The Measurement time is calculated from the Thread period that calls this API function, so set the Thread period to THREAD_OSS_ECAL_PERIOD[ms].

Return valueetSTSOSS-ECAL status code
eSTS_FINCompleted successfully
eSTS_EXEDuring execution
eSTS_ERR_MINMinimum temperature error (rlt.temperature is minimum temperature)
or
Minimum humidity error (rlt.humidity is minimum humidity)
eSTS_ERR_MAXMaximum temperature error (rlt.temperature is maximum temperature)
or
Maximum humidity error (rlt.humidity is maximum humidity)
eSTS_ERR_COMMAND_CODECommand selection error
eSTS_ERR_DIAGIf the comparison result is NG with the following commands
eCMD_DIAG_DEVI_ID
eCMD_DIAG_MANU_ID
eSTS_ERR_I2C_OBJECTI2C object selection error
eSTS_ERR_OTHERS_RUNOther components are executing the process
eSTS_ERR_HAL_OTHERS_RUNOther application is running HAL
eSTS_ERR_HAL_I2CHAL I2C error
Parameter INetCMD cmdOSS-ECAL command code
eCMD_WRITE_CFGCommand to write cfg value to Configuration Register (Pointer Register 0x02).

1. Calculate measurement time from the number of conversion bits for temperature and humidity.
2. Write cfg value to Configuration Register (Pointer Register 0x02).
eCMD_READ_TEMPCommand that reads the value in the Temperature Register, converts that value to a temperature, and stores that temperature in rlt.temperature

1. Write 0x00 to Pointer Register.
2. Wait until the Measurement time has elapsed (return value eSTS_EXE while waiting).
3. Read the value of Temperature Register.
4. Convert Temperature Register value to Temperature.
Temperature = (Temperature Register value/Temperature Gain) + Temperature Offset Value
(Min, Max Limit)
5. Store Temperature in rlt.temperature.
eCMD_READ_HUMICommand that reads the value in the Humidity Register, converts the value to humidity, and stores the humidity in rlt.humidity.

1. Write 0x01 to Pointer Register.
2. Wait until the Measurement time has elapsed (return value eSTS_EXE while waiting).
3. Read the value of Humidity Register.
4. Convert Humidity Register value to Humidity.
Humidity = Humidity Register value/Humidity Gain
(Min, Max Limit)
5. Store Humidity in rlt.humidity.
eCMD_READ_TEMP_HUMICommands that read the values in the Humidity Register and Temperature Register, convert that value to temperature and humidity, and store that temperature and humidity in rlt.temperature and rlt.humidity.

1. Write 0x00 to Pointer Register.
2. Wait until the Measurement time has elapsed (return value eSTS_EXE while waiting).
3. Reads the value of Temperature Register (Pointer 0x00) and Humidity Register (Pointer 0x01).
4. Converts Temperature Register readings to Temperature.
Temperature = (Temperature Register value/Temperature Gain) + Temperature Offset Value
(Min, Max Limit)
5. Convert Humidity Register value to Humidity.
Humidity = Humidity Register value/Humidity Gain
(Min, Max Limit)
6. Store Temperature in rlt.temperature.
7. Store Humidity in rlt.humidity.
eCMD_READ_SERI_IDCommand that reads the value of Serial ID and stores it in rlt.serialID.

1. Write 0xFB to Pointer Register.
2. Read Serial ID ( First ).
3. Write 0xFC to Pointer Register.
4. Read Serial ID ( Mid ).
5. Write 0xFD to Pointer Register.
6. Read Serial ID ( Last ).
7. Store Serial ID in rlt.serialID.
eCMD_READ_CFGCommand that reads the value of the Configuration Register and store the value in rlt.config.

1. Write 0x02 to Pointer Register.
2. Read Configuration Register.
3. Store the value read in rlt.config.
eCMD_DIAG_DEVI_IDCommand that reads the value of DeviceID Register and returns the result of comparing the value with 0x1050 as the return value.

1. Write 0xFF to Pointer Register.
2. Read DeviceID Register.
3. Returns the result of comparing the read value with 0x1050 as the return value.
True : eSTS_FIN
False : eSTS_ERR_DIAG
eCMD_DIAG_MANU_IDCommand that reads the value of ManufacturerID Register and returns the result of comparing the value with 0x5449 as the return value.

1. Write 0xFE to Pointer Register.
2. Read ManufacturerID Register.
3. Returns the result of comparing the read value with 0x5449 as the return value.
True : eSTS_FIN
False : eSTS_ERR_DIAG
uint16 cfgConfiguration register (Pointer 0x02) settingsFor cfg settings, please refer to the Datasheet “Configuration Register Description”.
Parameter OUTstHDC1080_O* rltReceive data from HDC1080
float32 temperatureTemperature [°C]
float32 humidityHumidity [%RH]
uint16 configRegister 0x02 Configuration
uint64 serialIDRegister 0xFB to 0xFD Serial ID (First, Mid, Last)
etSTS oHDC1080_WRITE_CFG( uint16 cfg )

The oHDC1080_WRITE_CFG function is an API function to write to the Configuration Register (Pointer Register 0x02) of the HDC1080.

  1. Calculate measurement time from the number of conversion bits for temperature and humidity.
  2. Write cfg value to Configuration Register (Pointer Register 0x02).

NOTE:
The measurement time is as follows. (Decimal places less than 1 ms are rounded up)
Temperature: 11bit conversion 3.65ms, 14bit conversion 6.35ms
Humidity: 8bit conversion 2.50ms, 11bit conversion 3.65ms, 14bit conversion 6.5ms
The Measurement time is calculated from the Thread period that calls this API function, so set the Thread period to THREAD_OSS_ECAL_PERIOD[ms].

Return valueetSTSOSS-ECAL status code
eSTS_FINCompleted successfully
eSTS_EXEDuring execution
eSTS_ERR_I2C_OBJECTI2C object selection error
eSTS_ERR_OTHERS_RUNOther components are executing the process
eSTS_ERR_HAL_OTHERS_RUNOther application is running HAL
eSTS_ERR_HAL_I2CHAL I2C error
Parameter INuint16 cfgConfiguration register (Pointer 0x02) settingsFor cfg settings, please refer to the Datasheet “Configuration Register Description”.
etSTS oHDC1080_READ_TEMP( stHDC1080_O* rlt )

The oHDC1080_READ_TEMP function is an API function that reads the value of the Temperature Register of the HDC1080, converts that value to a temperature, and stores that temperature in rlt.temperature.

  1. Write 0x00 to Pointer Register.
  2. Wait until the Measurement time has elapsed (return value eSTS_EXE while waiting).
  3. Read the value of Temperature Register.
  4. Convert Temperature Register value to Temperature.
    Temperature = (Temperature Register value/Temperature Gain) + Temperature Offset Value (Min, Max Limit)
  5. Store Temperature in rlt.temperature.

NOTE:
The Measurement time is calculated from the Thread period that calls this API function, so set the Thread period to THREAD_OSS_ECAL_PERIOD[ms].

Return valueetSTSOSS-ECAL status code
eSTS_FINCompleted successfully
eSTS_EXEDuring execution
eSTS_ERR_MINMinimum temperature error (rlt.temperature is minimum temperature)
eSTS_ERR_MAXMaximum temperature error (rlt.temperature is maximum temperature)
eSTS_ERR_I2C_OBJECTI2C object selection error
eSTS_ERR_OTHERS_RUNOther components are executing the process
eSTS_ERR_HAL_OTHERS_RUNOther application is running HAL
eSTS_ERR_HAL_I2CHAL I2C error
Parameter OUTstHDC1080_O* rltReceive data from HDC1080
float32 temperatureTemperature [°C]
float32 humidityHumidity [%RH] (not updated)
uint16 configRegister 0x02 Configuration (not updated)
uint64 serialIDRegister 0xFB to 0xFD Serial ID (First, Mid, Last) (not updated)
etSTS oHDC1080_READ_HUMI( stHDC1080_O* rlt )

The oHDC1080_READ_HUMI function is an API function that reads the value of the Humidity Register of the HDC1080, converts that value to humidity, and stores that humidity in rlt.humidity.

  1. Write 0x01 to Pointer Register.
  2. Wait until the Measurement time has elapsed (return value eSTS_EXE while waiting).
  3. Read the value of Humidity Register.
  4. Convert Humidity Register value to Humidity.
    Humidity = Humidity Register value/Humidity Gain (Min, Max Limit)
  5. Store Humidity in rlt.humidity.

NOTE:
The Measurement time is calculated from the Thread period that calls this API function, so set the Thread period to THREAD_OSS_ECAL_PERIOD[ms].

Return valueetSTSOSS-ECAL status code
eSTS_FINCompleted successfully
eSTS_EXEDuring execution
eSTS_ERR_MINMinimum humidity error (rlt.humidity is minimum humidity)
eSTS_ERR_MAXMaximum humidity error (rlt.humidity is maximum humidity)
eSTS_ERR_I2C_OBJECTI2C object selection error
eSTS_ERR_OTHERS_RUNOther components are executing the process
eSTS_ERR_HAL_OTHERS_RUNOther application is running HAL
eSTS_ERR_HAL_I2CHAL I2C error
Parameter OUTstHDC1080_O* rltReceive data from HDC1080
float32 temperatureTemperature [°C] (not updated)
float32 humidityHumidity [%RH]
uint16 configRegister 0x02 Configuration (not updated)
uint64 serialIDRegister 0xFB to 0xFD Serial ID (First, Mid, Last) (not updated)
etSTS oHDC1080_READ_TEMP_HUMI( stHDC1080_O* rlt )

The oHDC1080_READ_TEMP_HUMI function reads the values of the Humidity Register and Temperature Register of the HDC1080, converts them to temperature and humidity, and stores the temperature and humidity in rlt.temperature and rlt. temperature and rlt. humidity.

  1. Write 0x00 to Pointer Register.
  2. Wait until the Measurement time has elapsed (return value eSTS_EXE while waiting).
  3. Reads the value of Temperature Register (Pointer 0x00) and Humidity Register (Pointer 0x01).
  4. Converts Temperature Register readings to Temperature.
    Temperature = (Temperature Register value/Temperature Gain) + Temperature Offset Value (Min, Max Limit)
  5. Convert Humidity Register value to Humidity.
    Humidity = Humidity Register value/Humidity Gain (Min, Max Limit)
  6. Store Temperature in rlt.temperature.
  7. Store Humidity in rlt.humidity.

NOTE:
The Measurement time is calculated from the Thread period that calls this API function, so set the Thread period to THREAD_OSS_ECAL_PERIOD[ms].

Return valueetSTSOSS-ECAL status code
eSTS_FINCompleted successfully
eSTS_EXEDuring execution
eSTS_ERR_MINMinimum humidity error (rlt.humidity is minimum humidity)
or
Minimum temperature error (rlt.temperature is minimum temperature)
eSTS_ERR_MAXMaximum humidity error (rlt.humidity is maximum humidity)
or
Maximum temperature error (rlt.temperature is maximum temperature)
eSTS_ERR_I2C_OBJECTI2C object selection error
eSTS_ERR_OTHERS_RUNOther components are executing the process
eSTS_ERR_HAL_OTHERS_RUNOther application is running HAL
eSTS_ERR_HAL_I2CHAL I2C error
Parameter OUTstHDC1080_O* rltReceive data from HDC1080
float32 temperatureTemperature [°C]
float32 humidityHumidity [%RH]
uint16 configRegister 0x02 Configuration (not updated)
uint64 serialIDRegister 0xFB to 0xFD Serial ID (First, Mid, Last) (not updated)
etSTS oHDC1080_READ_SERI_ID( stHDC1080_O* rlt )

The oHDC1080_READ_SERI_ID function is an API function that reads the Serial ID value of the HDC1080 and stores the value in rlt.serialID.

  1. Write 0xFB to Pointer Register.
  2. Read Serial ID ( First ).
  3. Write 0xFC to Pointer Register.
  4. Read Serial ID ( Mid ).
  5. Write 0xFD to Pointer Register.
  6. Read Serial ID ( Last ).
  7. Store Serial ID in rlt.serialID.

NOTE:

Return valueetSTSOSS-ECAL status code
eSTS_FINCompleted successfully
eSTS_ERR_I2C_OBJECTI2C object selection error
eSTS_ERR_OTHERS_RUNOther components are executing the process
eSTS_ERR_HAL_OTHERS_RUNOther application is running HAL
eSTS_ERR_HAL_I2CHAL I2C error
Parameter OUTstHDC1080_O* rltReceive data from HDC1080
float32 temperatureTemperature [°C] (not updated)
float32 humidityHumidity [%RH] (not updated)
uint16 configRegister 0x02 Configuration (not updated)
uint64 serialIDRegister 0xFB to 0xFD Serial ID (First, Mid, Last)
etSTS oHDC1080_READ_CFG( stHDC1080_O* rlt )

The oHDC1080_READ_CFG function is an API function that reads the value of the Configuration Register of the HDC1080 and stores the value in rlt.config.

  1. Write 0xFF to Pointer Register.
  2. Read DeviceID Register.
  3. Returns the result of comparing the read value with 0x1050 as the return value.
    True : eSTS_FIN
    False : eSTS_ERR_DIAG

NOTE:
See Datasheet “Configuration Register Description”.

Return valueetSTSOSS-ECAL status code
eSTS_FINCompleted successfully
eSTS_ERR_I2C_OBJECTI2C object selection error
eSTS_ERR_OTHERS_RUNOther components are executing the process
eSTS_ERR_HAL_OTHERS_RUNOther application is running HAL
eSTS_ERR_HAL_I2CHAL I2C error
Parameter OUTstHDC1080_O* rltReceive data from HDC1080
float32 temperatureTemperature [°C] (not updated)
float32 humidityHumidity [%RH] (not updated)
uint16 configRegister 0x02 Configuration
uint64 serialIDRegister 0xFB to 0xFD Serial ID (First, Mid, Last) (not updated)
etSTS oHDC1080_DIAG_DEVI_ID( void )

The oHDC1080_DIAG_DEVI_ID function is an API function that reads the value of the DeviceID Register of the HDC1080 and returns the result of comparing that value with 0x1050 as the return value.

  1. Write 0xFF to Pointer Register.
  2. Read DeviceID Register.
  3. Returns the result of comparing the read value with 0x1050 as the return value.
    True … eSTS_FIN
    False … eSTS_ERR_DIAG

NOTE:

Return valueetSTSOSS-ECAL status code
eSTS_FINCompleted successfully
eSTS_ERR_DIAGDeviceID Register value and 0x1050 mismatch
eSTS_ERR_I2C_OBJECTI2C object selection error
eSTS_ERR_OTHERS_RUNOther components are executing the process
eSTS_ERR_HAL_OTHERS_RUNOther application is running HAL
eSTS_ERR_HAL_I2CHAL I2C error
etSTS oHDC1080_DIAG_MANU_ID( void )

The oHDC1080_DIAG_DEVI_ID function is an API function that reads the value of the ManufacturerID Register of the HDC1080 and returns the result of comparing that value with 0x5449 as the return value.

  1. Write 0xFE to Pointer Register.
  2. Read ManufacturerID Register.
  3. Returns the result of comparing the read value with 0x5449 as the return value.
    True : eSTS_FIN
    False : eSTS_ERR_DIAG

NOTE:

Return valueetSTSOSS-ECAL status code
eSTS_FINCompleted successfully
eSTS_ERR_DIAGManufacturerID Register value and 0x5449 mismatch
eSTS_ERR_I2C_OBJECTI2C object selection error
eSTS_ERR_OTHERS_RUNOther components are executing the process
eSTS_ERR_HAL_OTHERS_RUNOther application is running HAL
eSTS_ERR_HAL_I2CHAL I2C error

Files

Folder*Filesummary
HDC1080_HALNAME_VERSION/samplesample.c (.cpp)Sample Application Program
sample.hSample Application Header
HDC1080_HALNAME_VERSIONoHDC1080.c (.cpp)OSS-ECAL Program for HDC1080
oHDC1080.hOSS-ECAL Header for HDC1080
HDC1080_ARDUINO.inoSample application programs for Arduino
oss_ecal.hOSS-ECAL Common Header (Ver 01.01.00 or later, AUTOSAR is Ver 01.01.07 or later)
user_setting.c (.cpp)Const and Table of User setting
user_setting.hHeader of User setting
oHAL_i2c_stm32f4.cHAL Program for STM32Cube FW_F4
oHAL_i2c_stm32f4.hHAL Header for STM32Cube FW_F4
readme.mdReadme
OSS-ECAL Terms of Use.txtOSS-ECAL Terms of Use

* For HALNAME, please refer to HAL Support.

HAL Support List

HALMCU*Development environment*HALNAME
Arduino 1.8.6ATmega2560
ATmega328P
Mega 2560 Rev3
Arduino Pro Mini 3.3V
ARDUINO
ARM Mbed 6.17.0STM32F401RESTM32 Nucleo-64 boardsMBED
Infineon ModusToolbox HAL Cat1 2.4.3CYBLE-416045-02CY8CPROTO-063-BLE PSoC 6 BLE Prototyping KitModusToolbox
NXP MCUXpresso SDK
iMXRT1051B_1052B
ksdk2_0
MIMXRT1052DVL6AIMXRT1050-EVKBiMXRT1051B1052B
Renesas SSP 2.4.0R7FS7G27H3A01CFCS7G2 SKSSP
STM STM32Cube FW_F4 V1.27.1STM32F401RESTM32 Nucleo-64 boardsSTM32F4
Debian(Linux) v2022.04TI AM335xBeagleBone Black – Rev CLinux

* MCU and development environment at the time of development. Even if the same HAL is used, different MCUs and development environments may not work together.

OSS-ECAL Download Contact

Please login before contacting us for downloads.
To register as a new user, click here.

Built-in How to

How to incorporate OSS-ECAL into user programs

How to incorporate multiple OSS-ECALs in a user program (same MCU function)

How to incorporate multiple OSS-ECALs in a user program (different MCU function)

How to incorporate multiple identical electronic components into a user program

How to reduce the impact on user programs by replacing electronic components

CAUTION

The sample version of OSS-ECAL is not intended to be used with Threads (Tasks) or interrupts of different priority. Please do not use it as in the example below.

Example: If each sensor is assigned to the same ADC group and the OSS-ECAL API is executed in processes with different priorities, correct values may not be obtained.
ADC Gr0 Ch0 Temperature sensor AD22100A 100ms cycle Thread (low priority) to take in temperature
ADC Gr0 Ch1 Pressure sensor   MPX5999D Event interrupts (high priority) to take pressure

OSS-ECAL English
error: Content is protected !!