A few weeks ago I bought the ATLYS FPGA development board from Digilent. Unlike my other two FPGA development boards (NEXYS3, BASYS2) the ATLYS does not have a 7-segment display onboard. As I often use this during debugging I wanted to add some external 7-segment display to the ATLYS board. The ATLYS boards provides two connections for add-on boards: A high-density Vmod port and a 8-pin Pmod™ port. As I'm planning to use the Vmod port for other stuff I wanted to use the Pmod™ port for the 7-segment display.
On my other two FPGA bords the 7-segment display is directly connected to the FPGA. The 4-digit 7-segment display has four anodes (one per digit) and eight cathodes (one per segment plus the decimal point) totalling in twelve pins. The display control has to be multiplexed within the FPGA. As the Pmod™ connector has only eight pins this kind of control mechanism would not work. So the most obvious alternative to send the data for pins serially and to use serial to parallel converters on the extension board. However I wanted to avoid using a lot of ICs on the boards so I went for an alternative approach: Charlieplexing.
Charlieplexing is an 'improved' version of multiplexing that uses the fact that all of the I/O pins of the FPGA are tristate pins. A good description of it can be found in Maxim's Application Note 1880.
Charlieplexing requires a little bit more logic inside the FPGA, but using the 8-pins of the Pmod™ connector it allowed me to address 56 leds, which results in eight 7-segment digits (without the decimal point).
During my research I found the StickIt!-LedDigits by XESS which basically did exactly what I wanted. However I didn't wanted to buy a complete solution, but build it myself. So I designed similar PCB and soldered it together. The board consists of a Pmod™ connector which fulfills the Digilent Pmod™ Interface Specification, eight 7-segment displays and eight resistors. For the usage with the ATLYS development board the resistors can be choosen to 0 Ω as the pins supply a maximum of 24 mA. The KiCad layout files can be found at the project repository.
The VHDL part for driven the display is not very complex. It basically iterates through all of the digits and segments and switches them on/off depending of the data to be displayed. It is important to note, that at every time only one LED is active and not a complete digit as in traditionally multiplexing. What makes the code look a little bit complex is that depending of the digit the segment numbering changes a little bit. The VDHL module for the display can be found here.
As you can see the display is working fine, but as the FPGA only supplies up to 24 mA for the LEDs and due to the fact that only one segment can be on at a time, the brightness of the display is quite dim. So depending on the usage this might not be an ideal solution, but for debugging purpose this fits quite well.