A problem that occurs frequently in pic projects requiring readout
displays is lack of enough IO pins to control more than one or two displays
directly. Fortunately, this is a fairly easy problem to work around!
- with a bit of clever programming and a minimal bit of external hardware.
The obvious, direct scheme for running multiple displays is to assign
one output pin to each segment of each display. For example, to run
3 displays with 7 segments each will require 21 IO's. How inefficient!
Enter multiplexing - the process of using the same 7 IO pins
for each segment of each digit, plus one or more addressing
lines to control which display is currently on. The general
idea is based on persistance of vision - that if we scan through the
digits fast enough, they will appear to be continuously on.
So how exactly does this work?
Let's use a 3 digit readout for the rest of this tutorial. How many
IO's will we need? 1 for each segment, plus 3 addressing lines (there
are further improvements, and it's possible to do it with 2 addressing
lines for up to four digits, but for the sake of simplicity in introduction,
we'll use 3 addressing lines). That gives us a total of 10 IO lines.
To see more clearly how this works, look at the animation below:

Lines 1, 2 & 3 conrol the on/off state of each digit.
Lines a-g control which segment of the currently on digit are
lit up. If we change the state of lines a-g to correspond to which digit
is currently on as we scan through the digits (by scanning through lines
1-3), and we do this fast enough, then each digit will appear to be
solidly on, and will be displaying it's own value.
So there's the theory of it - now it's
time to actually implement it!
top