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.

CC1350: Receive interrupt on DIO15

Part Number: CC1350
Other Parts Discussed in Thread: OPT3001

Hi.

I am trying to run the CC1350 launhpad example with Sensors devpack.
I am successfully reading Lux from the sensors dev-pack using TI driver i2copt3001.c 

However, I do not manage to get to interrupt. I've put breakpoints in interrupt handler and replaced:

GPIOCC26XX_DIO_15 | GPIO_DO_NOT_CONFIG, 

With:

GPIOCC26XX_DIO_15 | GPIO_CFG_IN_INT_RISING,

And added the needed structures to CC1350_LAUNCXL.c:

OPT3001_Object OPT3001_object[CC1350_LAUNCHXL_OPT3001COUNT];

const OPT3001_HWAttrs OPT3001_hwAttrs[CC1350_LAUNCHXL_OPT3001COUNT] = {
        {
#ifdef BOOSTXL_BASSENSORS
            .slaveAddress = OPT3001_SA1,
#else // BOOSTXL_SENSORS
            .slaveAddress = OPT3001_SA4,
#endif
            .gpioIndex = CC1350_LAUNCHXL_OPT3001_INT,
        },
};

const OPT3001_Config OPT3001_config[] = {
    {
        .hwAttrs = &OPT3001_hwAttrs[0],
        .object  = &OPT3001_object[0],
    },
    {NULL, NULL},
};

Where:

/*!
 *  @def    CC1350_LAUNCHXL_GPIOName
 *  @brief  Enum of GPIO names
 */
typedef enum CC1350_LAUNCHXL_GPIOName {
    CC1350_LAUNCHXL_GPIO_S1 = 0,
    CC1350_LAUNCHXL_GPIO_S2,
    CC1350_LAUNCHXL_OPT3001_INT,
    CC1350_LAUNCHXL_SPI_SLAVE_READY,
    CC1350_LAUNCHXL_GPIO_LED_GREEN,
    CC1350_LAUNCHXL_GPIO_LED_RED,
    CC1350_LAUNCHXL_GPIO_TMP116_EN,
    CC1350_LAUNCHXL_GPIO_SPI_FLASH_CS,
    CC1350_LAUNCHXL_SDSPI_CS,
    CC1350_LAUNCHXL_GPIO_LCD_CS,
    CC1350_LAUNCHXL_GPIO_LCD_POWER,
    CC1350_LAUNCHXL_GPIO_LCD_ENABLE,
    CC1350_LAUNCHXL_GPIOCOUNT
} CC1350_LAUNCHXL_GPIOName;

Still, I don't manage to stop in the interrupt routine...

  • Are you trying to trigger on a lux signal? Does it get high enough to trigger an output? Have you tried just a digital read?
  • Are you trying to trigger on a lux signal?

    Yes

    Does it get high enough to trigger an output?

    Yes - I measured 

    Have you tried just a digital read?

    Yes, I can read from the device

    As you can see in the picture, I set high limit to 400.0 and measured 3206.3999. Still I don't get any interrupts...

  • Could you please specify which example, which lines you are modifying in which files?

    I looked at the code for the OPT3001 in and in the board file I found

    #ifdef BOOSTXL_BASSENSORS
    #define OPT3001_INT_PIN GPIOCC26XX_DIO_27
    #else // BOOSTXL_SENSORS
    #define OPT3001_INT_PIN GPIOCC26XX_DIO_15
    #endif

    indicating that DIO15 is actually in use in this example

  • Hi.

    I also used DIO_15 for my example. As I mentioned in my original post:

    However, I do not manage to get to interrupt. I've put breakpoints in interrupt handler and replaced:

    1
    GPIOCC26XX_DIO_15 | GPIO_DO_NOT_CONFIG,

    With:

    1
    GPIOCC26XX_DIO_15 | GPIO_CFG_IN_INT_RISING,

    With your post I looked in CC1350_LAUNCHXL.c and found that it is also using DIO_15, but in the example project there was also:

    GPIO_PinConfig gpioPinConfigs[] = {
        ...
        OPT3001_INT_PIN | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_FALLING,
        ...
    };

    So when I changed

    GPIOCC26XX_DIO_15 | GPIO_CFG_IN_INT_RISING,

    with

    GPIOCC26XX_DIO_15 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_FALLING

    I managed to solve it and stop at breakpoint inside the interrupt routine.

    Thank you very much:)