Basically the problem is “When we press any key on Row 0, we get two key events instead of one. Rows 1, 2 and 3 all work properly and as expected.” In other words it seems that two keys were pressed, ONLY at Row 0. Here is the details. Please help me out.
Terms Used: When referring to Key numbers such as Key 1, or Key 12 we are referring to raw key codes as described in “Table 6. Key Value Assignment” in the TCA8418 Datasheet, “SCPS215B - September 2009 - Revised March 2010”. Problem Overview: When we press any key on Row 0, we get two key events instead of one. Rows 1, 2 and 3 all work properly and as expected. Press Key 1: We get Key Events, Key 1 Press and Key 2 Press. Press Key 2: We get Key Events, Key 2 Press and Key 3 Press. Press Key 3: We get Key Events, Key 3 Press. Release Events have the same behavior as the Press Events except normally the keys are reversed in that instead of getting Key 1 Press then Key 2 Press, we get Key 2 Released, Key 1 Released. We have also found that if we change the configuration to be a 4x4 keypad then we get duplicates on Key 3 as well, or if we change to a 2x2 keypad then we do not get duplicates on Key 2. So basically, we never get duplicates on the key that corresponds to the highest numbered Column that is configured. Our Keypads: We have two keypads, one hard and one tactile (buttons click) that are both 4 row, 3 column keypads. Both keypads have the exact same behavior. The only difference layout wise between the keypads is Column 0 starts on the right for one keypad, and starts on the left for the other. Hardware Design: ROW0 – ROW3 are connected from the TCA8418 to the keypads along with COL0-COL2. There are no pull-ups, pull-downs or capacitors between the TCA8418 and the keypad. We are relying on the 100K 3.3V pull-up in the TCA8418 on the ROWs to help drive the logic high in the Open Drain Circuit. Actual Configuration: To setup the TCA8418 we write the following raw data to it (Address = Data). We basically want to use a 4(rows)x3(cols) Matrix Keypad that generates interrupts on key events. This is in the format Write [REGISTER] = [VALUE]. Write 0x01 = 0x69 Write 0x1A = 0x00 Write 0x1B = 0x00 Write 0x1C = 0x00 Write 0x1D = 0x03 Write 0x29 = 0x00 Write 0x2C = 0x00 Write 0x1E = 0x03 Write 0x2A = 0x00 Write 0x2D = 0x00 Write 0x1F = 0x00 Write 0x2B = 0x00 Write 0x2E = 0x00 Write 0x03 = 0x00 Write 0x02 = 0x1F We originally only set the pull-up and de-bounce configuration for the Rows and Columns that we actually use, but also tried disabling all pull-ups, enabling all pull-ups, disabling all de-bouncing and enabling all de-bouncing. Currently all de-bouncing and pull-ups are enabled. During Interrupt (Duplicate Keys): This shows the registers that we read from and write to (and their contents) when get an Interrupt in the case of Duplicate Keys. For this, we’ve configured the keypad as 2x2. Read Register 0x02: Contents: 0x01 Read Register 0x03: Contents: 0x02 Read Register 0x04: Contents: 0x81 Read Register 0x04: Contents: 0x82 Write Register 0x02: Contents: 0x01 During Interrupt (Correct Keys): This shows the registers that we read from and write to (and their contents) when get an Interrupt in the case of Duplicate Keys. For this, we’ve configured the keypad as 2x2. Read Register 0x02: Contents: 0x01 Read Register 0x03: Contents: 0x01 Read Register 0x04: Contents: 0x82 Write Register 0x02: Contents: 0x01 Test 1, Bypassing Keypads and using Wires Directly: We directly shorted ROW0 and COL1 using a jumper to remove our Keypads from the equation, and still find the same result as when we use the Keypad. Test 2, Configuring System for 2x1 Keypad: We also configured the system to work with a 2 Column 1 Row Keypad and got identical results. Test 3, Leaving COL0 and ROW0 Connected: If we do this, the first time that we connect them we get the Key 1 Pressed, Key 2 Pressed as we have seen earlier. However at intervals between 1 second and 15 seconds we get additional events for Key Press 2 / Key Release 2. We have not tested to see if this occurs by holding the key down on our keypad yet. For Example We Get The Following Events: Key Press 1 Key Press 2 Key Press 2 Key Release 2 Key Press 2 Key Release 2 … We do not think that this is some sort of un-documented key-repeat feature as well as the repeat rate is not constant as it varies between 1 second and 15 seconds. As soon as the repeat starts, we only get the single Key event as we expect, however it is for Key 2 instead of Key 1.