7 Segment Hexadecimal Driver
7-Segment Hexadecimal Display Driver
If you build your own microcomputers, or repair older ones (see bus display below), you have probably run into the need to display hexidecimal values on a 7-segment LED display. An internet search will quickly turn up a few options: the MC14495, EP/EEP-ROMS, GALs, and discrete logic.
Each of these solutions have advantages and disadvantages:
- The MC14495 uses a lot of current (up 10 100ma per display), and they cost over $10 each
- EPROMS/ROMS work just fine, but tend to have larger DIP packages, and require external components (current limiting resistors).
- GALs are an option, but can require external resistors.
- Discrete Logic (or even diode arrays) work fine, but take up a lot of board space, is a lot of wiring for just a single display. Oh, and you have to power all of the chips.
I had several projects that needed 7-segment hexidecimal displays, and I wasn’t willing to pay the premium price or burn all that power. I had some ATTiny44’s on hand and decided I would make my own driver.
The Tiny44 display driver has a number of advantages:
- It uses inexpensive ($2) ATTiny44 microcontrollers. These are pretty easy to program on any platform.
- No current limiting resistors are needed, due to 1/7 duty cycle for each segment
- Lower power consumption, due to 1/7 duty cycle for each segment
- Supports common anode and common cathode displays
- Optional: display segment test at power on
You will find the code here.
Operation is straight forward: the nibble to display is input on PB0,PB1,PB2 & PA7. Seven segment data is output on PA0 through PA6. Each segment is only illuminated 1/7th of the time, with a configurable delay between segments (default is 10uS).
Common cathode is assumed as the default. Common anode is configured by defining COMMON_ANODE. By default the segment test is enabled, but can easily be turned off by commenting out SEGMENT_TEST.
Circuit connections are simple:
In my case, I had a number of NKR-141 common cathode displays that I pulled from an old industrial equipment display panel.