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 event application

Other Parts Discussed in Thread: TCA8418

My device is using TCA8418 to scan key press/release , but I didn't want to remember key event on TCA8418.

ex:

If the user was executing TCA8418 press/release count x 3 -> Truth , the device execute : TCA8418 press/release x 1

Could you guide me how to set the register?

Thanks.

  • Hello Hoo,

    Thanks for the question! I'll be happy to help you with that.
    Allow me to verify what you're asking.

    Your question: You want to set the TCA8418 up to only show the current button being pressed only. You do not wish to use the FIFO in the device.


    If this is what you're asking for and your keys are in a multiplexed array, the easiest approach will just be to respond to any INT requests from the TCA device quickly, and handle this sort of operation in your driver. In most use cases, you will only see a single key press or release in the FIFO if you have a quick-to-respond MCU/processor because humans tend to press buttons very slowly in comparison to how quickly a computer reacts. What this means, is that your MCU will likely see 3 button presses as 6 interrupts with 1 button press/release each over a course of time.

    The TCA8418 device does not have the ability to perform this de-duplication itself (it merely puts whatever button is pressed into a FIFO, and it's up to your driver to read the FIFO and choose how to respond).

    To do what you ask, I would suggest the following:
    1) Setup your keys in keyscan mode (if you have them setup in a multiplexed array. (This is done with the KP_GPIO registers). Also make sure that your DEBOUNCE_DIS registers are all set to 0x00, as this will make sure that debouncing is Enabled, this will help with noisy switches
    2) When your driver responds to an INT request, it will most likely see only 1 event in the FIFO
    3) Put this key into some buffer in your MCU's memory and start a timer (a time out timer, of whatever extra debouncing window you want)
    4) If any new key presses/events for the same key come in during this extra debouncing window, you can ignore it.
    5) Once extra debouncing time window expires, act on the button press.