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.

TCA6424 : Interrupt Functionaity for Long Press - Short Press keys.

Other Parts Discussed in Thread: TCA6424, TCA6424A

Hi All,

We are in a Process of evaluating TCA6424 chip. We have connected 8 push button switches to TCA6424 Input Port.

When going through the data sheet i came across :

8.4.3 Interrupt Output (INT)
An interrupt is generated by any rising or falling edge of the port inputs in the input mode. After time tiv, the signal
INT is valid. Resetting the interrupt circuit is achieved when data on the port is changed to the original setting or
when data is read from the port that generated the interrupt. Resetting occurs in the read mode at the
acknowledge (ACK) or not acknowledge (NACK) bit after the rising edge of the SCL signal. Interrupts that occur
during the ACK or NACK clock pulse can be lost (or be very short) due to the resetting of the interrupt during this
pulse. Each change of the I/Os after resetting is detected and is transmitted as INT.
Reading from or writing to another device does not affect the interrupt circuit, and a pin configured as an output
cannot cause an interrupt. Changing an I/O from an output to an input may cause a false interrupt to occur, if the
state of the pin does not match the contents of the Input Port register.
The INT output has an open-drain structure and requires pullup resistor to VCCP or VCCI depending on the
application. If the INT signal is connected back to the processor that provides the SCL signal to the TCA6424A
then the INT pin has to be connected to VCCI. If not, the INT pin can be connected to VCCP.

We have a query to TI team as we need to confirm this chip (Expecting a quick response ):

Considering a push button connected to Port 0.0 . when Pressed will generate interrupt and can be detected.

Similarly can we differentiate long Press or short Press for the same.

We are asking this question as after getting an interrupt & reading the respective port, the interrupt circuit will be resetted and the port will switch back to original setting. As per datasheet.

So holding a key for long time will generate an interrupt and once the port register is read the state of the pin will go back to original setting & hence releasing of key might not generate an interrupt.

Can someone Please review the above understanding for the chip with respect to Push button connected.

 

  • Hi,

    Considering a push button connected to Port 0.0 . when Pressed will generate interrupt and can be detected.

    Similarly can we differentiate long Press or short Press for the same.

    So holding a key for long time will generate an interrupt and once the port register is read the state of the pin will go back to original setting & hence releasing of key might not generate an interrupt.


    In general, if you have connected switch through GPIO and used for interrupt generation.

    You have to mention that what type of INTERRUPT are you going to detect, ie LEVEL triggering or EDGE triggering.

    If it is LEVEL then LOW or HIGH.

    If it is EDGE then LOW_to_HIGH or "HIGH_to_LOW" or BOTH

    Ex:

    irq_set_irq_type(irq_num,IRQ_TYPE_EDGE_BOTH);

  • HI Titusrathinaraj,

    Thank for your interest.

    The active low interrupt pin is connected via gpio. the interrupt is configured as IRQF_TRIGGER_FALLING which goes HIGH_TO_LOW.

            IO_PIN_NUM i.e 19

            chip->irqnum = gpio_to_irq(IO_PIN_NUM);

            error = request_threaded_irq(chip->irqnum, NULL,
                             tca6424_keys_isr,
                             IRQF_TRIGGER_FALLING,
                             "tca6424-keys", chip);

    I am looking forward can i configure an interrupt. which can trigger an interrupt on press & release of key.

    Please reply with your suggestions.




    a

  • Hi Hrishikesh,

    Have a try.

           error = request_threaded_irq(chip->irqnum, NULL,
                             tca6424_keys_isr,
                             IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
                             "tca6424-keys", chip);

  • Hi Titusrathinaraj thanks for your support. I am getting two interrupt . One on Pressing & one on releasing. with below configuration.

    error = request_threaded_irq(chip->irqnum, NULL,
                             tca6424_keys_isr,
                             IRQF_TRIGGER_FALLING, 
                             "tca6424-keys", chip);

    Thank you very much.

  • Hi Hrishikesh,

    Sounds good.

    Thanks for your update.

    Could you please tell me which one is worked for you. So that it could help others right ?

    This one ?

    error = request_threaded_irq(chip->irqnum, NULL,
                      tca6424_keys_isr,
                      IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
                      "tca6424-keys", chip);

    else,

    error = request_threaded_irq(chip->irqnum, NULL,
                             tca6424_keys_isr,
                             IRQF_TRIGGER_FALLING,
                             "tca6424-keys", chip);

  • Hi,

    error = request_threaded_irq(chip->irqnum, NULL,
                             tca6424_keys_isr,
                             IRQF_TRIGGER_FALLING,
                             "tca6424-keys", chip);

     

    The above one has mysteriously worked for me.

    As the int pin on TCA6424 is active low, i ahd some daughts in getting interrupts on Press and release.

    But some how the chip triggers two interrupt i.e on press and release. even though we configure it for IRQF_TRIGGER_FALLING .

     

    Thanks for support & interest.