
-----------+
8051       |
           |
  Port Pin +----------> A >--+
           |                 |
           |       +--> B >--+
           |       |
           |      -+-
           |      GND
           |
    other  +---------->   >---
    keypad :          :   :     to key
    port   :          :   :     matrix
    pins   +---------->   >---
           |
-----------+