Nearly three years ago, I purchased a bunch of bubble magnified 7-segment displays, probably intended for calculators (rememeber LED display calculators?). I purchased the lot for a reasonable price, thinking I was receiving 20 displays. Turns out I was getting 20 bags of 10, plus 30-some loose displays! I decided to build a 3-byte (6 hex char) parallel hex display using a PIC microcontroller to handle the multiplexing. I had some PIC16F88 devices on hand, and lashed this together on a breadboard:
After that, I purchased some PICs with more I/O, some prototyping breakout boards (64 pin TQFP is hard to prototype otherwise), and basically forgot about the project. Last weekend, I had reason to revive it for another project, and have so far implemented most of what I wanted to accomplish:
The displays are a mix of 8- and 9-digit devices. I built the prototype with a 9-digit device, but I'm only driving 8 digits at the moment. I was able to reuse some of the multiplexing code from my last go at this project, and continued the same basic approach with this implementation. The current (work in progress) source is available on GitHub at https://www.github.c...ajs/hex_display
It's implemented as a bitmapped display, with the LSB corresponding to segment A and the MSB corresponding to the decimal point. Bit patterns are held in an 8-byte display buffer. An interrupt-driven multiplexing routine pulls characters out of the display buffer and pushes them out to the display, calling a subroutine to turn on the appropriate character. Since the subroutine is interrupt-driven from one of the PIC's timers, the PIC is free to do other tasks in the time in between.
While the display is primarily intended to be a debugging tool, displaying binary data as hex, I designed it in such a way that none of the "interesting" device pins are tied up by the display itself. It's possible to modify the firmware to take input from I2C, SPI, RS-232, the parallel slave port, or any of the ADCs on the PIC.