PIC Microcontroler based Keyboards

4x4 keyboard with only 4 io pins:


    Key         SET PORT B TO                READ PORT B AS
           RB3  RB2  RB1  RB0     |     RB3   RB2   RB1   RB0
    SW1     HiZ  HiZ  HiZ   0      |      0     0     1     X
    SW2     HiZ  HiZ  HiZ   0      |      0     1     0     X
    SW3     HiZ  HiZ  HiZ   0      |      0     1     1     X
    SW4     HiZ  HiZ  HiZ   0      |      1     0     0     X
    SW5     HiZ  HiZ   0   HiZ     |      0     0     X     1
    SW6     HiZ  HiZ   0   HiZ     |      0     1     X     1
    SW7     HiZ  HiZ   0   HiZ     |      0     1     X     0
    SW8     HiZ  HiZ   0   HiZ     |      1     0     X     1
    SW9     HiZ   0   HiZ  HiZ     |      0     X     1     1
    SW10    HiZ   0   HiZ  HiZ     |      0     X     0     1
    SW11    HiZ   0   HiZ  HiZ     |      0     X     1     0
    SW12    HiZ   0   HiZ  HiZ     |      1     X     0     1
    SW13     0   HiZ  HiZ  HiZ     |      X     0     1     1
    SW14     0   HiZ  HiZ  HiZ     |      X     1     0     1
    SW15     0   HiZ  HiZ  HiZ     |      X     1     1     0
    SW16     0   HiZ  HiZ  HiZ     |      X     0     0     1

See also: http://www.mikerj.clara.net/keypad.html

Questions: