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.

CC2652P: On the problem of too low interrupt efficiency

Part Number: CC2652P

Hello, I use this chip CC2652P.During testing, I found that using the interrupt callback function provided by the SDK, the interrupt response was 70us, which was too long, so I used the IOCINT registration (void (* PFNHandler) function in the lib library to reprocess the call from the interrupt source.When an interrupt is triggered, I use the GPIO_clearMultiDio function to remove the interrupt flag bits.But after a long and quick rest.The interrupt cannot continue, I want to know if there is anything in the interrupt source that I have not done.At the same time, I changed the trigger function of the interrupt source, but the interrupt response time was still too long.I saw your company's description at interr_doc.h that a small delay was added before the interrupt source.I wonder if there is any other way to deal with this problem。

Thanks!

  • Hello,

    I assume you are referring to the I/O Controller and interrupt resources from the DriverLib Documentation?  Here are some additional E2E posts that are relevant to your needs:

    https://e2e.ti.com/f/1/t/1008629 
    https://e2e.ti.com/f/1/t/789323 
    https://e2e.ti.com/f/1/t/1011192 
    https://e2e.ti.com/f/1/t/855676 

    Please let me know if you continue to experience any difficulties.  I'm not familiar with interr_doc.h, can you please point to the directory from which it can be found?

    Regards,
    Ryan

  • Interrupt_doc.h in sourxe/ti/device/cc13x2_cc26x2/driverlib, I used GPIO_clearMultiDio in my own interrupt source call function, but in the event of a too fast and rapid interrupt,One of the external interrupts in this interrupt source is not responding

  • //this is my code

    static inline void
    myIOCIntRegister(void (*pfnHandler)(void))
    {
    // Register the interrupt handler.
    IntRegister(INT_AON_GPIO_EDGE, pfnHandler);

    //中断优先级拉到最高
    IntPrioritySet(INT_AON_GPIO_EDGE , 0);

    // Enable the IO edge interrupt.
    IntEnable(INT_AON_GPIO_EDGE);
    }

    void pin_irq_init(void)
    {
    //IntRegister(INT_I2C_IRQ,irq_hand);
    //IntEnable(INT_I2C_IRQ);
    myIOCIntRegister(irq_hand);
    }

    void irq_hand(void)
    {
    IntDisable(INT_AON_GPIO_EDGE);
    _nop();
    _nop();
    if(hw_resource.gpio_key1 != PIN_UNASSIGNED)
    {
    if(my1GPIO_getEventMultiDio(IOID2PIN(GPIOCC26XX_config.pinConfigs[hw_resource.gpio_key1])))
    {
    //if(!myGPIO_readMultiDio(IOID2PIN(GPIOCC26XX_config.pinConfigs[hw_resource.gpio_key1])))
    //{
    gpio_key1_isr(0);
    //myLED_tst_on();
    myGPIO_clearMultiDio(IOID2PIN(GPIOCC26XX_config.pinConfigs[hw_resource.gpio_key1]));
    //GPIO_clearInt(hw_resource.gpio_key1);
    //}
    //else{
    //gpio_key1_isr(0);
    //myLED_tst_off();
    //myGPIO_clearMultiDio(IOID2PIN(GPIOCC26XX_config.pinConfigs[hw_resource.gpio_key1]));
    //}
    }
    }

    IntEnable(INT_AON_GPIO_EDGE);

    }

  • I found that even if I redefined the calling function of the interrupt source, the efficiency of the interrupt was still around 60us, and the CPU did not sleep. Could you tell me how to optimize it faster

    Thanks

  • Thank you for clarifying the file name and location.  I was expecting your code to use IOC* functions (IOCPortConfigureSet, IOCIntClear, IOCIntEnable, etc.) for a specific GPIO pin allocation.  You can also use Insert -> Code in the reply box to format code snippets.  Are you saying that you were able to successfully implement a driverlib solution but that this only reduced the interrupt latency by 10 us?  Can you provide an example by using the empty project as a template?

    Regards,
    Ryan

  • #define IOID2PIN(ioid)  (1 << ioid)
    #define key1 GPIOCC26XX_DIO_11
    #define led1 IOID_6

    void irq_handle(void)
    {
        GPIO_clearMultiDio(IOID2PIN(key1));
        _nop();
        _nop();
        if(GPIO_readMultiDio(IOID2PIN(key1)))
        {
            GPIO_Write(key1,1);
        }
        else
        {
            GPIO_Write(key1,0);
        }
    }






    int main(void)
    {
        GPIO_setConfig(led1, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);
        GPIO_setConfig(key1, GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_BOTH_EDGES);

        IOCIntRegister(irq_handle);
        while (1)
        {
            sleep(1);
        }
        
    }

    This is similar code, you can try it, I still need why I cleared the interrupt source, but after many rapid interrupts, the interrupt is not available, and even so, the delay is about 60μs, which is the main reason for the program delay before this function, I wonder if you can tell me how to solve it

    Thanks!

  • I see several things concerning about this code: IOCIntEnable is never used, GPIO_Write is used on a pin configured to be an input, using *MultiDio commands for a single DIO, the lack of led1 functionality, and the fact that sleep(1) should enter standby for 1 second and the wakeup timing from standby to active is typically 160 µs from the datasheet (14 µs for idle to active).  I recommend that you reference other examples to further refine your use case.

    Regards,
    Ryan

  • Hello, I interrupt program according to the lib descriptions in the library, after completion of rewriting, began a period of time can be used, such as a period of time can't use, I found that after I get the register of the abnormal state of I/O and clear the status of the register is the same, and I found that no matter how to read or write is done with 1 in flags,So I guess this register is not a real hardware register, but a fixed legal memory, whether this will affect my own interrupt operation, I now do not know whether the interrupt program will enter when the interrupt cannot be triggered, because I cannot printf in the interrupt source program, if it is entering,But because I use the gpio_getEventMultidio function to get the flag bit is not available, I cannot perform the corresponding I/O handler function,Could you please give me a solution? Thank you very much

  • I do not fully understand your explanation, can you please provide a code snippet to help clarify the issue?

    Regards,
    Ryan