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.

TCA8418 key detect questions

Other Parts Discussed in Thread: TCA8418E

  1. Normally, the IOExpander generate an interrupt if it detects a change in key event.  When the interrupt is not generated, if we want to know the actual # of keys being pressed, how can we find out? 
  2. While holding down a key (Key A), if we very quickly release and press the same key again, will the IOExpander generate two interrupts or only one interrupt?  If only one interrupt, then will the key events reported  in order as happened (ie. key A release event and then key A press event)?

  • Hello Dan,

    1) In order to determine the number of keys actively being pressed on the TCA8418E, it depends how you have the device configured.

    If you are referring to matrix mode, then the keys will show up in the FIFO, but only one time for each press/release event that occurs. The device does not show you a "current matrix mode key press" type of information, since that would then require the end user to do post processing to determine if a key was pressed or released. Instead, it shows you when a key is pressed or released with a single entry in the FIFO.

    If you are using keys in GPIO mode (not matrix mode) where you have 1 key per port, you can see the state of each GPIO by reading the GPIO_DAT_STAT1-3 registers.

    2) As a human, a "very quick" release and press may be ~100 ms. To a machine, this is very slow. It is most probable that the MCU will service 2 separate interrupts unless the MCU is slow to respond, in which case, it might see only 1 interrupt. However, that would be a very slow-to-respond MCU. It is most likely it will have ample time to service the key release interrupt, and then have some time until it sees the interrupt from the key press.

    All key events are reported in the FIFO in order of how they happened.