Bascom AVR application note no. 105 (www.mcselec.com/an_105.htm) describes a simple circuit for using an AT90S2313 (an 8-bit AVR microcontroller) to transmit RC5 or Sony remote control codes. In this circuit, a small 3 × 4 matrix is used to connect 12 pushbutton switches to only 7 pins of the microcontroller (see Figure 1).If you need more pushbuttons, the matrix will have to be extended, but quite a bit can be achieved using a simple auxiliary circuit. If the three column bits are used to drive a demultiplexer, up to 32 pushbuttons can be connected. Figure 2 shows and example of such an approach. Here a 74HC138 has been chosen for the demultiplexer. This IC has inverted outputs. If active-high outputs are more convenient for software reasons, the pin-compatible 74HC238 can be used instead.
Discussion (0 comments)