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.

CCS/HDC2010: Question about the interrupt configuration of HDC2010

Part Number: HDC2010

Tool/software: Code Composer Studio

Hi Expter,

One customer is using HDC2010 on the sensor project and face some issue with the interrupt. Could you look into this and check how to configure the registers properly?

 Description:

Made the below change in hdc2010.c

bool HDC2010_setTempLimit(HDC2010_Handle handle, HDC2010_TempScale scale, float high, float low)
{    //modify++++++++++++++++++++++++

    hi_temp = (int16_t)((high * MAX_CELSIUS_PER_LSB) + 40U * MAX_CELSIUS_PER_LSB);
    lo_temp = (int16_t)((low * MAX_CELSIUS_PER_LSB) + 40U * MAX_CELSIUS_PER_LSB);

 

}

 

Testing the over-threshold alert function in the i2chdc2010_CC1352R1_LAUNCHXL_tirtos_ccs project, configuration as below.

 /* Initialize hdc2010Params structure to defaults */
    HDC2010_Params_init(&hdc2010Params);

    hdc2010Params.humResolution = HDC2010_H14_BITS;
    hdc2010Params.tempResolution = HDC2010_T14_BITS;

    hdc2010Params.outputDataRate = HDC2010_TRIGG_ON_DEMAND;

    hdc2010Params.interruptPinPolarity = HDC2010_ACTIVE_LO;
    hdc2010Params.interruptEn = HDC2010_ENABLE_MODE;
    hdc2010Params.interruptMask = (HDC2010_InterruptMask) (HDC2010_DRDY_MASK | HDC2010_TH_MASK | HDC2010_TL_MASK | HDC2010_HH_MASK | HDC2010_HL_MASK);
    hdc2010Params.interruptMode = HDC2010_LEVEL_MODE;
    hdc2010Params.measurementMode = HDC2010_HT_MODE;
    hdc2010Params.callback = &hdc2010Callback;

Power on the device, it ran into hdc2010Callback() once, alert bit was set successfully; Change the environment temperature(making it beyond the setting threshold), the state register showed the state changes, but didn’t generation the INT signal and ran into hdc2010Callback(). How could customer get the INT triggered when the temperature is beyond the threshold?

 

  • Hi Lenna,

    Thank you for your post. 

    What is their goal with the interrupt? Are they looking to use just the high and low temperature interrupts? 

    Can they also probe the HDC2010 DRDY/INT line and show that behavior on a logic analyzer or oscilloscope so we can see how the pin is behaving now? 

    Best Regards,
    Brandon Fisher

  • Hi Brandon, 

    Thanks for your kindly reply. Yes, they use it just for high and low temperature interrupts.

    The interrupt is set to be active in low. Power on the device, it will trigger interrupt once, and then keeps high voltage even as the temperature is beyond the high temp threshold. (test by logic analyzer).

    If configure this device to periodic sample mode, the INT signal can be seen at the INT pin when the data is ready.

    const PIN_Config BoardGpioInitTable[] = {

        /* Parent Signal: CONFIG_I2C_HDC SDA, (DIO27) */

        CONFIG_PIN_2 | PIN_INPUT_EN | PIN_PULLDOWN | PIN_IRQ_DIS,

        /* Parent Signal: CONFIG_I2C_HDC SCL, (DIO26) */

        CONFIG_PIN_3 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,

        /* XDS110 UART, Parent Signal: CONFIG_UART_0 TX, (DIO13) */

        CONFIG_PIN_0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,

        /* XDS110 UART, Parent Signal: CONFIG_UART_0 RX, (DIO12) */

        CONFIG_PIN_1 | PIN_INPUT_EN | PIN_PULLDOWN | PIN_IRQ_DIS,

        /* LaunchPad LED Red, Parent Signal: CONFIG_LED_0_GPIO GPIO Pin, (DIO6) */

        CONFIG_PIN_4 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,

        /* HDC2010 Interrupt, Parent Signal: CONFIG_GPIO_HDC2010_INT GPIO Pin, (DIO25) */

        CONFIG_PIN_5 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_DIS,

        PIN_TERMINATE

    };

    Best regards,

    Lenna

  • Hi Lenna,

    They DRDY/INT pin can only enable bits mask each other, so they could only have it reflect either the Temperature High threshold, or the temperature low threshold. The priority is discussed in section 8.3.4. of the datasheet. That doesn't appear to be the problem they are having here though. 

    Lenna Yan said:
    If configure this device to periodic sample mode, the INT signal can be seen at the INT pin when the data is ready.

    When the device is in trigger-on-demand mode, they must ensure they are manually triggering the measurements at a regular interval, or else the HDC2010 will never update the temperature register and recognize that a high-temperature interrupt should be issued. By default in this example code I believe that the HDC2010 is set to a 2Hz conversion rate.

    They will need to modify the code to regularly trigger measurements from the HDC2010 if they want to use this device in trigger on demand mode. That would be most simply done by adding a call to the HDC2010_triggerMeasurement function into the while loop used to print the results out over UART. Have them try this and let me know their results. 

    Best Regards,
    Brandon Fisher

  • Hi Brandon,

    Thanks for your great support.

    Let me make it more clear.

    1. If the customer set the device to trigger on demand mode, they must triggering the measurements at a regular interval, like 10s interval. Otherwise, the HT interrupt won't work well;

    2. what about the auto measurement mode? Will the device still need set triggering the measurements at a regular interval?

  • Hi Lenna,

    Lenna Yan said:
    1. If the customer set the device to trigger on demand mode, they must triggering the measurements at a regular interval, like 10s interval. Otherwise, the HT interrupt won't work well;

    Technically this does not have to be triggered at a constant rate (every 10s or some other interval), but the interrupt status will only update once a measurement is taken where the temperature or humidity is greater (or less in the case of low limits) than the corresponding threshold register. So if no measurements were taken, then the interrupt would never trigger. In code, it is probably easier for them to trigger at a regular rate. 

    Lenna Yan said:
    2. what about the auto measurement mode? Will the device still need set triggering the measurements at a regular interval?

    No, in auto measurement mode they would only need to trigger the first measurement. Every other measurement will be automatically triggered and taken by the device at the configured rate. Similar to trigger-on-demand mode, the interrupt would trigger at the same time as a measurement outside their limits occurred.

    Best Regards,
    Brandon Fisher