I've posted an update to AN205 Interfacing a Matrix Keyboard that shows how to connect a matrix keypad using an I2C I/O expander. In addition to using fewer I/O lines and being simpler to construct, this method also has the advantage of being easily used in interrupt mode.
The example code for AN205 now includes three projects: the original polling code using the ShiftIn/ShiftOut interface, a similar polling example using the I2C I/O expander, and an interrupt driven example using the I/O expander that uses WaitForInterrupt().
Keyboard Interfacing Application Note Updated
Keyboard Interfacing Application Note Updated
- Don Kinzer