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.

CC2640: multiple interrupt handling

Part Number: CC2640

Tool/software: TI-RTOS

Hello,

I am working on pin interrupts,

here I configured PIN interrupts and it's working fine,

here problem is multiple interrupts in capacitive sensor,

here I want one interrupt at one time and all other interrupts must be discarded, in my design cap sensors are very near to each other so if user don't touch it carefully it will generate multiple interrupts,

now I have to make this system robust,

if multiple touch are there and multiple interrupts occurs i want any one capacitive touch should work,

as I am using PIN interrupt after completing one ISR other pending interrupt will start implement it's ISR.

QUESTION:

Is there any method to discard pending interrupts?

if it's there tell me how to implement it?

  • Hi Jaydipsinh,

    There is no way of discarding the other pending interrupts when using the PIN driver, you would have to "discard" them inside the ISR. Regarding capacitive touch, have you looked at the examples that is available for the Sensor Controller Engine using Sensor Controller Studio?
  • Hello,
    I have checked everything for capacitive touch, there is no problem with it. problem is multiple interrupts,
    if i want to discard interrupts inside ISR what should i do?
    regards,
    jaydipsinh
  • Hi,

    I did not imply that there was anything wrong, just asked if you had looked into it. The way of implementing Cap. touch using the sensor controller would give you the ability to filter the result as you want before interrupting the main processor.

    Regarding the interrupts, what you would do is to simply "don't care" about the other PINs that you are not interested in. If you can't stop the "ghost" interrupts from happening, you simply need to filter them in software. Unless you would implement your own "PIN driver" (which I do not recommend) this means that you will need to expect that you can get an interrupt from any or all pins at once and then inside the callback choose to discard or act on it.
  • Hello M-W,
    I understand your concern to handle such problem, but here I am using more than 20 pins just for capacitive touch so I can not use sensor controller studio, that's why I am using pin interrupts. I tried filter interrupts but then it's giving more delay for notification.

    one more thing I noticed in PIN driver is this function PIN_Status PIN_clrPendInterrupt(PIN_Handle handle, PIN_Id pinId).
    can we use it for disabling pending interrupts?

    regards,
    jaydipsinh
  • Hi,

    The answer is yes and no. While you can use that function to clear any pending events, once the PIN Hwi is called, it will save a copy of any event flag register which will be used inside the PIN Swi to invoke the callback functions related to these evebts.

    This means that when you get the first callback in your application, it is already to late to clear the pending interrupts. You could potentially clear any pending interrupts that just came in, but as Hwi > Swi, it is likely that it will save the flag state before you have time to clear it.
  • Hello,

    Thanks for your detailed explanation,
    I will try finding some solution to handle these interrupts inside my application.
    thanks again.

    regards,
    jaydipsinh