1. To simplify decoding of a 4x4 keypad matrix, an 8-bit port was configured as inputs using internal pull-up and pull-down resistors the microprocessor.
In the simplest setup, an 8-bit port is configured as inputs, with internal pull-up resistors on bits 0-3 and internal pull-down resistors on bits 4-7 (Fig. 1). This is possible with several microprocessors, including STMicroelectronics’ STM32F100. In fact, this circuit was prototyped with the STM32F100, and wound up delivering excellent results.
The design in Figure 2 employs external pull-up and pull-down resistors. The best solution implements two resistor arrays, such as the widely available four-element surface-mount types—they’re compact, inexpensive, and add only two components to the circuit board. For most pull-up and pull-down applications, 10 k⦠will suffice.