This repository implements a scanning controller for a multiplexed seven-segment display, with various configurable utility modules and a top-level module designed for Digilent's Nexys A7-100T board with 16 input switches and 8 seven-segment digits. A scanning controller is necessary for this board's unique seven-segment display configuration, with all identical segments on every digit tied to the same pin, and a separate enable pin for each digit. This means that, in order to display different data on each digit, the digits must be iteratively enabled with separate segment-enable masks.
- Clone this repository
cd
to the repository root folder- Add appropriate constraints file at
source/constraints/constraints.xdc
- On Mac/Linux, just run
make setup
- On Windows,
cp source/constraints/templates/digilent/Nexys-A7-100T-Master.xdc source/constraints/constraints.xdc
- On Mac/Linux, just run
- Open
seven-segment-controller.xpr
in Vivado - Build and deploy project to board
- Input switches represent value to be encoded on the seven-segment displays
- The A7-100T includes a decimal point in each digit, which can be controller as follows:
- The current selected digit is displayed on the lowest 4 LEDs
- The left push-button increases the digit index by 1, while the right decreases the index by 1 (where the digit on the right is the lowest-indexed digit)
- The center push-button enables or disables the decimal point on the selected digit
- The CPU reset button resets the selected digit and enabled decimal points
This repository is designed to be used as a git submodule, from where the components (described below) can be used, either indivdually or together.
The Vivado project is configured to look for the constraints file at source/constraints/constraints.xdc
, which is not included in this repository to allow for other boards to be targeted without affecting the source. All of Digilent's boards have their default constraints files in source/constraints/templates/digilent
(merged from Digilent's constraints templates repository), and can be copied or linked to the expected location from there.
You may notice that the Makefile
s make a hard link between the template constraints file and the expected location, and that there is a post-checkout
git hook installed to remove and recreate this link on every checkout; this is to facilitate developing this project on Mac/Linux system and using a Windows VM with shared directories to actually build and deploy the project. Windows does not fully support Unix-style symlinks, so a hard link must be used instead; however, git does not recognize hard links and will overwrite them when performing checkout
operations. Thus, the git hook will re-create the hard link after every checkout to ensure the link is always correct.
This repository consists of a few major modules.
SevenSegmentController_top
: the top-level controller, instantiating and driving the scanning seven-segment controller, with behavior described aboveSevenSegmentController
: the scanning seven-segment controller, with a configurable number of digits and digit refresh rateSevenSegmentEncoder
: an encoder mapping input bitstrings to seven-segment enable masksClockDivider
: a clock divider with configurable number of clock divisions by 2Debouncer
: a counter-based signal debouncer with configurable counter width
Each module has documentation at the top of the file describing its usage in more detail.