LED Dot Graph -- with CMOS Decoder


The previous project was certainly direct, but it consumed ten port pins in the process. That seems a bit profligate, so let's cut things down to four pins by means of some external hardware.

We'll use the CMOS CD4514 decoder; it sets 1-of-16 bits high based upon the 4-bit number at the input. But a new problem arises. This particular chip has limited output current capabilities, so we'll need to roll out the trusty ULN2003A Darlington driver array to beef things up. In fact, we'll need two of them to cover all 10 elements of the LED dot display. There are always trade-offs, aren't there! In this case, the software is simple as hell, and only four PIC port pins are required, but the hardware increases somewhat. Still, even if you never use this particular configuration, it's a good exercise for learning about decoders. Check out the schematic.


PortB.0 through PortB.3 drive the CD4514 decoder. Only ten outputs of the latter then feed to the Darlington driver arrays which draw current from the selected LED element. Since only one output at a time can ever be selected by the decoder, we really only need one current limiting resistor; hence all of the anodes of the LED array are ganged. Note that for best operation, decoupling capacitors should be used throughout. These are assumed but not shown in the schematic.

The software is trivial, but you might want to notice how the

{$INIT PORTS OUTPUT}

directive is used to set the ports to output mode.

Click to get the source code.
Click to get the schematic PDF.

Next Project: LED Dot Graph -- via Charlieplexing

No comments:

Post a Comment