Friday, January 20, 2012

Reading multiple switches from one I/O pin

Normally one input switch requires one digital input pin of a microcontroller. Use of keypad style multiplexing saves some input pins while interfacing an array of switches. There exist another technique based on ADC channel that allows to connect multiple switches on a single input pin of a microcontroller. This tutorial from Embedded Lab demonstrates this as applied to PIC12F683 microcontroller.


In this example, there are four LEDs and four tact switches connected to the PIC12F683 microcontroller. While each LED is controlled through an individual I/O pin, the four switches are connected to one ADC input pin of the PIC12F683 microcontroller.

0 comments:

Post a Comment