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.

RTOS/LAUNCHXL-CC1310: CC1310 interrupt response delay

Part Number: LAUNCHXL-CC1310
Other Parts Discussed in Thread: CC1310

Tool/software: TI-RTOS

i use cc1310 to build a project, in the program, i config a pin as interrupt source: Board_KeyMode | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES, then creat a callback fuction in the callback function , use CPUdelay(800*20) to filter some distrubs, but i found the interrupt sometime doesnot response when the key was pushed or released, and sometime the callback function was called while there is no key movement, why is that?

  • Hi Michael,

    Could you provide some code snippets on how you set up the PIN? Also, you have any other PIN interrupts setup in parallel to this one?
  • PIN_Config buttonPinTable[] = {
    Board_UderVoltage | PIN_INPUT_EN | PIN_NOPULL | PIN_IRQ_NEGEDGE,
    Board_KeyDetect | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE,
    Board_KeyMode | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES,//PIN_IRQ_NEGEDGE,
    PIN_TERMINATE
    };
    //----------------------------------------------------
    buttonPinHandle = PIN_open(&buttonPinState, buttonPinTable);
    if (!buttonPinHandle)
    {
    System_abort("Error initializing button pins\n");
    }
    if (PIN_registerIntCb(buttonPinHandle, &buttonCallback) != 0)
    {
    System_abort("Error registering button callback function");
    }
    //-------------------------------------------------------------
    void buttonCallback(PIN_Handle handle, PIN_Id pinId)
    {
    uint32_t ltemp;

    /* Debounce logic, only toggle if the button is still pushed (low) */
    CPUdelay(800*20);

    if(PIN_getInputValue(Board_KeyMode) == 0){
    //logic
    }
    }
    //----------------------------------------------------------------------------
    the Board_KeyMode pin was set up to detect both rising and falling edge, but some time it doesnot work as i expected.
  • Hi,

    Your code snippet looks OK to me, a small observation is that you group 3 pins together in your pin table. This means the callback will be called when any of those pins cause an interrupt/event, is this what you expect?

    If you are debugging the device and pause after an "not working" key press, has any interrupt been registered on hardware level (i.e. are the interrupt flag set for the PIN)?