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: 00374, 00484, 00524)
OSS-ECAL specification
API Function
etSTS oHDC1080( etCMD cmd, uint16 cfg, stHDC1080_O* rlt )
Return value
Parameter IN
Parameter OUT
etSTS
etCMD cmd
uint16 cfg
stHDC1080_O* rlt
OSS-ECAL status code
OSS-ECAL command code
Configuration register (Pointer 0x02) settings
Receive data from HDC1080
etCMD
eCMD_WRITE_CFG
Feature :
Command to write cfg value to Configuration Register (Pointer Register 0x02).
Process :
1. Calculate the Measurement time.
2. Write cfg value to Configuration Register (Pointer Register 0x02).
Command API function :
etSTS oHDC1080_WRITE_CFG( uint16 cfg )
Return value :
eSTS_FIN
eSTS_ERR_HAL_I2C
eSTS_ERR_COMMAND_CODE
eSTS_ERR_OTHERS_RUN
eSTS_ERR_I2C_OBJECT
NOTE :
For cfg settings, please refer to the Datasheet “Configuration Register Description”.
Measurement time is rounded up to the next time.
Temperature 11bit 3.65ms, 14bit 6.35ms
Humidity 8bit 2.50ms, 11bit 3.65ms, 14bit 6.5ms
eCMD_READ_TEMP
Feature :
Command to read the value of Temperature Register, convert it to Temperature, and save it to rlt.temperature.
Process :
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.
Command API function :
etSTS oHDC1080_READ_TEMP( stHDC1080_O* rlt )
Return value:
eSTS_FIN
eSTS_EXE
eSTS_ERR_HAL_I2C
eSTS_ERR_COMMAND_CODE
eSTS_ERR_OTHERS_RUN
eSTS_ERR_I2C_OBJECT
eSTS_ERR_MIN
eSTS_ERR_MAX
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].
eCMD_READ_HUMI
Feature :
Command to read the value of Humidity Register values, convert it to Humidity, and save it to rlt.humidity.
Process :
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.
Command API function :
etSTS oHDC1080_READ_HUMI( stHDC1080_O* rlt )
Return value :
eSTS_FIN
eSTS_EXE
eSTS_ERR_HAL_I2C
eSTS_ERR_COMMAND_CODE
eSTS_ERR_OTHERS_RUN
eSTS_ERR_I2C_OBJECT
eSTS_ERR_MIN
eSTS_ERR_MAX
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].
eCMD_READ_TEMP_HUMI
Feature :
Command to read the Humidity Register and Temperature Register values, convert them to temperature and humidity, and save them to rlt.temperature and rlt.humidity.
Process :
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.
Command API function :
etSTS oHDC1080_READ_TEMP_HUMI( stHDC1080_O* rlt )
Return value :
eSTS_FIN
eSTS_EXE
eSTS_ERR_HAL_I2C
eSTS_ERR_COMMAND_CODE
eSTS_ERR_OTHERS_RUN
eSTS_ERR_I2C_OBJECT
eSTS_ERR_MIN
eSTS_ERR_MAX
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].
eCMD_READ_SERI_ID
Feature :
Command to read the Serial ID value and save it to rlt.serialID.
Process :
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.
Command API function :
etSTS oHDC1080_READ_SERI_ID( stHDC1080_O* rlt )
Return value:
eSTS_FIN
eSTS_ERR_HAL_I2C
eSTS_ERR_COMMAND_CODE
eSTS_ERR_OTHERS_RUN
eSTS_ERR_I2C_OBJECT
Note :
eCMD_READ_CFG
Feature :
Command to read the Configuration Register and save it to rlt.config.
Process :
1. Write 0x02 to Pointer Register.
2. Read Configuration Register.
3. Store the value read in rlt.config.
Command API function :
etSTS oHDC1080_READ_CFG( stHDC1080_O* rlt )
Return value :
eSTS_FIN
eSTS_ERR_HAL_I2C
eSTS_ERR_COMMAND_CODE
eSTS_ERR_OTHERS_RUN
eSTS_ERR_I2C_OBJECT
Note :
See Datasheet “Configuration Register Description”.
eCMD_DIAG_DEVI_ID
Feature :
Command that returns the comparison result between the DeviceID Register value and 0x1050 as a return value.
Process :
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
Command API function :
etSTS oHDC1080_DIAG_DEVI_ID( void )
Return value :
eSTS_FIN
eSTS_ERR_DIAG
eSTS_ERR_HAL_I2C
eSTS_ERR_COMMAND_CODE
eSTS_ERR_OTHERS_RUN
eSTS_ERR_I2C_OBJECT
Note :
eCMD_DIAG_MANU_ID
Feature :
Command that returns the comparison result between the ManufacturerID Register value and 0x5449 as a return value.
Process :
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
Command API function :
etSTS oHDC1080_DIAG_MANU_ID( void )
Return value:
eSTS_FIN
eSTS_ERR_DIAG
eSTS_ERR_HAL_I2C
eSTS_ERR_COMMAND_CODE
eSTS_ERR_OTHERS_RUN
eSTS_ERR_I2C_OBJECT
Note:
stHDC1080_O
float32 temperature
float32 humidity
uint16 config
uint64 serialID
HDC1080 Register 0x00 Temperature to float TEMPERATURE[degrees Celsius]
HDC1080 Register 0x01 Humidity to float HUMIDITY[%RH]
HDC1080 Register 0x02 Configuration
HDC1080 Register 0xFB~0xFD Serial ID (First, Mid, Last)
Files
Folder* | File | summary |
---|---|---|
HDC1080_HALNAME/sample | sample.c (.cpp) | Sample Application Program |
| sample.h | Sample Application Header |
HDC1080_HALNAME | oHDC1080.c (.cpp) | OSS-ECAL Program for HDC1080 |
| oHDC1080.h | OSS-ECAL Header for HDC1080 |
| oss_ecal.h | OSS-ECAL Common Header (Ver 01.01.00 or later) |
| user_setting.c (.cpp) | Const and Table of User setting |
| user_setting.h | Header of User setting |
oHAL_i2c_stm32f4.c | HAL Program for STM32Cube FW_F4 | |
oHAL_i2c_stm32f4.h | HAL Header for STM32Cube FW_F4 | |
| readme.md | Readme |
| OSS-ECAL Terms of Use.txt | OSS-ECAL Terms of Use |
* For HALNAME, please refer to HAL Support.
HAL Support List
MCU/Board manufacturer | HAL | MCU* | Development environment* | HALNAME |
---|---|---|---|---|
Arduino | Arduino 1.8.6 | ATmega2560 ATmega328P | Mega 2560 Rev3 Arduino Pro Mini 3.3V | ARDUINO |
ARM | Mbed 6.17.0 | STM32F401RETx | STM32 Nucleo-64 boards | MBED |
Infineon | ModusToolbox HAL Cat1 2.4.3 | CYBLE-416045-02 | CY8CPROTO-063-BLE PSoC 6 BLE Prototyping Kit | ModusToolbox |
NXP | MCUXpresso SDK iMXRT1051B_1052B ksdk2_0 | CYBLE-416045-02 | IMXRT1050-EVKB | iMXRT1051B1052B |
Renesas | SSP 2.4.0 | R7FS7G27H3A01CFC | S7G2 SK | SSP |
STM | STM32Cube FW_F4 V1.27.1 | STM32F401RETx | STM32 Nucleo-64 boards | STM32F4 |
* 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
Please login before downloading. To register as a new user, please click here.
HAL | Download OSS-ECAL Ver |
---|---|
Arduino 1.8.6 | |
Mbed 6.17.0 | |
ModusToolbox HAL Cat1 2.4.3 | |
MCUXpresso SDK iMXRT1051B_1052B ksdk2_0 | |
SSP 2.4.0 | |
STM32Cube FW_F4 V1.27.1 |
“ABC.zip was blocked because this type of file can harm your device.” in Microsoft Edge.
If you are unable to download the File, please contact us and let us know the model number and HAL type. We will send you the file as an email attachment.
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