Shop OBEX P1 Docs P2 Docs Learn Events
I2c Keypad — Parallax Forums

I2c Keypad

Ron CzapalaRon Czapala Posts: 2,418
edited 2014-07-03 07:52 in General Discussion
Testing how the schematic appears on the forum...
This object uses the Interrupt-On-Change feature of the Microchip MCP23008 I/O Expander chip to interface a 4x4 Matrix Keypad (Parallax #27899) to a propeller MCU.
See Microchip's Application Note AN1081 at [URL]http://ww1.microchip.com/downloads/en/AppNotes/01081a.pdf[/URL]
When a key on the keypad is pressed, the MCP23008 goes LOW and the propeller scans the rows and columns to determine which key is pressed.
Then it clears the interrupt as the key is released.

             ┌───┐   ┌───┐   ┌───┐   ┌───┐
        ┌────┫ 1 ┣───┫ 2 ┣───┫ 3 ┣───┫ A │
        │    └─┳─┘   └─┳─┘   └─┳─┘   └─┳─┘
        │    ┌─┻─┐   ┌─┻─┐   ┌─┻─┐   ┌─┻─┐  K
        │ ┌──┫ 4 ┣───┫ 5 ┣───┫ 6 ┣───┫ B │  E
        │ │  └─┳─┘   └─┳─┘   └─┳─┘   └─┳─┘  Y
        │ │  ┌─┻─┐   ┌─┻─┐   ┌─┻─┐   ┌─┻─┐  P
        │ │ ┌┫ 7 ┣───┫ 8 ┣───┫ 9 ┣───┫ C │  A
        │ │ │└─┬─┘   └─┬─┘   └─┬─┘   └─┬─┘  D
        │ │ │┌─┻─┐   ┌─┻─┐   ┌─┻─┐   ┌─┻─┐
        │ │ ││ * ┣───┫ 0 ┣─┳─┫ # ┣───┫ D │
        │ │ │└─┳─┘   └─┳─┘ │ └─┳─┘   └─┳─┘
        │ │ │  │       │   │   └─┐ ┌───┘
        │ │ │  │       └───┼───┐ │ │
        │ │ │  └───────────┼─┐ │ │ │
        │ │ └────────────┐ │ │ │ │ │
        │ └────────────┐ │ │ │ │ │ │
        └────────────┐ │ │ │ │ │ │ │
                     8 7 6 5 4 3 2 1
            ┌──────┫ │ │ │ │ │ │ │
            ┣──────┼─┫ │ │ │ │ │ │    
        10k ┣──────┼─┼─┫ │ │ │ │ │
            ┣──────┼─┼─┼─┫ │ │ │ │   
            ┣──────┐ │ │ │ │ │ │ │ │   
            │    ┌─┴─┴─┴─┴─┴─┴─┴─┴─┴─┐   ─ GP7 thru GP0 (GP7 thru GP4 are pulled high with 10K resistors)
            │    │ +                 │
            │    │                   │
            │    │•    MCP23008      │
            │    │                   │
            │    │                 - │
            │    └─┬─┬─┬─┬─┬─┬─┬─┬─┬─┘
            │      S S A A A R   I │
            │      C D 2 1 0 E   N │
            │      L A │ │ │ S   T │
            │      │ │ └─┻─┻─┼───┼─┻────VSS
            └─┳────┼─┼────┳──┻───┼──────VDD
              └──┫ ┣──┘      │      3.3V
               4.7k│ │4.7k       │
                   │ │           │
                   
                    Propeller pins  

Comments

Sign In or Register to comment.