This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

HDC2080: DRDY pin does not goes down after reading TH_STATUS

Part Number: HDC2080

Hello,

Base on the next configuration, DRDY pin goes high every time HDC2080 sense higher than 31 C degrees but I'm not able to get the pin back to zero after reading TH_STATUS as it says in section 8.3.5.1 from spec. Is there something else that I'm missing?

//Define Register Map
#define TEMP_LOW 0x00
#define TEMP_HIGH 0x01
#define HUMID_LOW 0x02
#define HUMID_HIGH 0x03
#define INTERRUPT_DRDY 0x04
#define TEMP_MAX 0x05
#define HUMID_MAX 0x06
#define INTERRUPT_CONFIG 0x07
#define TEMP_OFFSET_ADJUST 0x08
#define HUM_OFFSET_ADJUST 0x09
#define TEMP_THR_L 0x0A
#define TEMP_THR_H 0x0B
#define HUMID_THR_L 0x0C
#define HUMID_THR_H 0x0D
#define CONFIG 0x0E
#define MEASUREMENT_CONFIG 0x0F
#define MID_L 0xFC
#define MID_H 0xFD
#define DEVICE_ID_L 0xFE
#define DEVICE_ID_H 0xFF
#define ADDR 0x40

#define HDC2080_ICR_DRDY_ENABLE 0x80
#define HDC2080_ICR_TH_ENABLE 0x40
#define HDC2080_ICR_HH_ENABLE 0x10

#define HDC2080_SOFT_RES 0x80
#define HDC2080_AMM 0x20 // 1/60 Hz (1 sample every minute)
#define HDC2080_DRDYINT_EN 0x04
#define HDC2080_INT_POL 0x02
#define HDC2080_MEAS_TRIG 0x01

void HDC2080_initialize(){

    uint8_t data = 0;

    /*
    *   Configuración para registro INTERRUPT_CONFIG
    *   TH_ENABLE = 1
    */
    data = HDC2080_ICR_TH_ENABLE;
    i2c_master_write_slave(ADDR, INTERRUPT_CONFIG, data, 1);
    i2c_master_read_slave(ADDR, INTERRUPT_CONFIG, &data, 1);
    printf("Registro 0x07 = %X\n", data);

    /*
    *   Configuración para registro TEMP_THR_H
    *   Límite de temperatura inicial = 40 C
    *   Este valor se cambiará más adelante para ajustar al valor del ambiente
    *   Valor de 0x6E calculado con fórmula en Spec
    */
    data = 0x6E;
    i2c_master_write_slave(ADDR, TEMP_THR_H, data, 1);
    i2c_master_read_slave(ADDR, TEMP_THR_H, &data, 1);
    printf("Registro 0x0B = %X\n", data);

    /*
    *   Configuración para registro Reset and DRDY/INT
    *   DRDY/INT_EN = 1
    *   INT_POL = 1
    *   INT_MODE = 1
    */
    data = HDC2080_DRDYINT_EN | HDC2080_INT_POL | HDC2080_INT_MODE;
    i2c_master_write_slave(ADDR, CONFIG, data, 1);
    i2c_master_read_slave(ADDR, CONFIG, &data, 1);
    printf("Registro 0x0E = %X\n", data);   

}

By the way, I found previously an error in the published spec: 

Regards,

Pascal.

  • Hello Ernesto,

    Can you please let us know what is the sampling rate and other configuration for the HDC2080, that you have programmed?
  • Hello Amit,

    I have found the problem of my issue and I updated my code with the next configuration:

    void HDC2080_initialize(){

    uint8_t data = 0;

    /*
    * Configuración para registro INTERRUPT_CONFIG
    * TH_ENABLE = 1
    * HH_ENABLE = 1
    */
    data = HDC2080_ICR_TH_ENABLE| HDC2080_ICR_HH_ENABLE;
    i2c_master_write_slave(ADDR, INTERRUPT_CONFIG, data, 1);

    /*
    * Configuración para registro TEMP_THR_H
    * Límite de temperatura inicial = 40 C
    * Este valor se cambiará más adelante para ajustar al valor del ambiente
    * Valor de 0x7C calculado con fórmula en Spec
    */
    data = 0x7C;
    i2c_master_write_slave(ADDR, TEMP_THR_H, data, 1);

    /*
    * Configuración para registro HUMID_THR_H
    * Límite de humedad relativa inicial = 80 %
    * Este valor se cambiará más adelante para ajustar al valor del ambiente
    * Valor de 0xCD calculado con fórmula en Spec
    */
    data = 0xCD;
    i2c_master_write_slave(ADDR, HUMID_THR_H, data, 1);

    /*
    * Configuración para registro Reset and DRDY/INT
    * Auto Measurement Mode = 0.1 Hz (1 sample every 10 seconds)
    * DRDY/INT_EN = 1
    * INT_POL = 1
    */
    data = HDC2080_AMM | HDC2080_DRDYINT_EN | HDC2080_INT_POL;
    i2c_master_write_slave(ADDR, CONFIG, data, 1);
    }

    It works well now.

    Thanks!