2. Keypad
The keypad uses 8 switches and 6 input ports on the AVR Microcontroller to implement a
switch-matrix keypad. Using individual keys and combinations of two keys pressed one
after the other a full set of letters, numbers and symbols can be typed.
2.1 Circuit Diagram
Fig 2.1
The visible part of the circuit includes only the switches, but inside the microcontroller, the
column signals are set up to connect to some 'pull-up' resistors which are connected to
VCC. PortC, bits 3 to 0 are always set up as inputs. PortB0 and PortD7 are normally set
up as inputs without pull-up resistors, and when we're actually reading keys either PortB0
or PortD7 (but never both together) are set up as outputs.
To understand how the switches themselves work you'll need to first understand Potential
Dividers
(Appendix
A).