Project - FEZ Spider with touchscreen and 2 PCF8574 as adaptable I2C Keypad

FEZ Spider with touchscreen and 2 PCF8574 as adaptable I2C Keypad

FEZ Spider with touchscreen as adaptable I2C Keypad
In systems with I2C-Bus often keypads are used to control the device. Usually hardware keypads are used, which often use PCF 8574 I2C port extenders to identify the pressed keys. With one PCF 8574 a maximum of 8 keys can be decoded, for more than 8 keys 2 PCF 8574s and additional components are needed although one PCF 8574 can provide 256 (8 I/O ports) different logical states. In keypads with PCF 8574 the PCF 8574 port extender serves as a slave on the I2C-Bus. When a key is pressed, one of the 8 I/O ports is pulled low. As the result of the change of the logical state of one of the I/O ports, the int-output of the PCF 8574 is pulled low. The int-output of the PCF 8574 is connected with an interrupt-input of the processor (I2C-Bus-Master). The I2C- Bus-Master than reads the state of the PCF 8574 and so gets the information which key was pressed. In the here provides solution a FEZ Spider mainboard with T35 touchscreen is used as the keypad. Two PCF 8574 circuits are used to transport the command-code of the touched key to the I2C-Bus-Master. Via a Gadgeteer extender module the spider mainboard transmits the 8-bit command-code of the key over the spiders I2C-Bus to the first PCF 8574. The 8 I/O ports of this first PCF 8574 are directly connected with the corresponding I/O ports of a second PCF 8574. When the command-code of the touched key is written to the first PCF 8574 its I/O ports change from hex FF to the keys command-code. Since so the I/O port states of the second PCF 8574 changes, the second PCF 8574 sends an interrupt to the I2C-Bus-Master, which then reads the state of the second PCF 8574 and so gets the command-code of the touched key. The time in which the key-state is present and the time between different key-states can be adjusted to the requirements of the I2C-Bus-Master. The number of keys, the text on the keys and the command-code of the keys can be adapted. Special Keypad layouts can be stored on a SD-Card and can be loaded from there. The 5 V supply-voltage for the PCF 8574s can either be taken from the I2C-Bus-Master or from the extender module of the FEZ-spider (this was not tested). Of course it is not allowed to connect both supply-voltages. The Glide-library is used to provide the graphical-user-interface, the Glide.keyboard is adapted to the FEZ-Spider and the T35 320x240 touchscreen.
For more information consult the ReadMe.pdf file.

Interesting. Thanks for sharing. :slight_smile:

Nice write up. Thanks for sharing and for doing such a thorough job including all the reference diagrams/images. Thanks!