- Discrete LEDs
- Dot/Bar LEDs
- Matrix LEDs
- 7-Seg LEDs
- Serial -- Software
- Serial -- Hardware
- RS-232 via the MAX3232
- I2C -- EEPROM
- I2C -- DS1307 Real Time Clock
- 1-Wire -- DS18B20, Powered, Single-Drop
- 1-Wire -- DS18B20, Powered, Multi-Drop
- 1-Wire -- DS18B20, Parasitic, Multi-Drop
- TI Link Protocol -- Calculator Demo
- Infrared Communication
- MIDI -- Output Demo
- MIDI -- Input Demo
- MIDI to Analog Synth
LED Dot Graph -- with CMOS Counter
In a previous exercise, we saw how to reduce the port pin count from ten to four with the help of a CMOS decoder chip. But we can go one step further and get it down to three by pressing the ubiquitous CD4017 counter into service. I mean, after all, a decade counter is made to order for a ten-element LED dot display!
The technique is straightforward. We'll simply disable the LEDs, then count up to the desired number, and finally turn them on again to display the desired LED element. This all happens so fast, it appears that we've simply turned an LED on, nothing more. In other words, this approach gives all the appearance of having come up with a one-of-ten decoder. Check out the schematic.
First thing to observe is that the anodes are ganged and go through a single resistor, since only one element will be lit at a time. This resistor is then fed by PIC PortB.2 (pin 8) which acts as an enable control. When high, the selected LED will light, but when low, all LEDs are dark.
PortB.0 (pin 6) toggles the CD4017 reset pin; this forces the counter to begin at the beginning, of course, as it counts upward to the desired number. PortB.1 (pin 7) is the clock line which steps the counter along.
Once more we find that the CMOS chip is incapable of providing enough current to get the job done, so we call upon IC3 and IC4 (Darlington arrays) to provide the needed boost.
So, yes, it's a trifle complex, but then again, only three port pins are required, and that's surely worth something!
Click to get the source code.
Click to get the schematic PDF.
Next Project: LED Bar Graph -- Direct Drive