- Published: Saturday, 04 April 2009
- Written by Digital DIY
- Hits: 6213
This is a very limited example of segment displays. For full functionality and extended library support, please go to the multiple segment display tutorial.
7 segment displays are a cheap and effective way to display data. The only real downsides to them are;
- Unable to retain data if more than one display is used (ie, need to continually refresh each segment display)
- Require many Pins to interface (7 for one display, 16 for two and so on)
The data that they display can be manipulated so that the same 7 data lines can multiplex information onto other displays at the same time. This can be seen in the Multiple section. But for now, and future routines, this diagram illustrates how to connect a common cathode 7 segment display to a PIC micro.
The box that the 7 segment is in represents the common. There are two types of 7 segment displays, common cathode and common anode. In my projects, I use common cathode displays. i.e.
As you can see, to control any of the segments, a +ve signal is required, as they all share the same earth. aka common cathode.
The chances of creating an application that only need a single segment display are fairly limited, but none the less, I made a Swordfish User Library (Single Segment Display Library) to make it very easy to interface with. Here's an example of the library, take note that you can define which port is in use;
The "Update" procedure will decode a single digit from 0-9 and display the relevant data on the segment display, easy.