Beginning FPGA Programming - Partie76
Beginning FPGA Programming - Partie76
Figure 16-11. end of the architecture deisgn of the 7 segment display counter
Figure 16-12. segment display design example top level block diagram
375
Chapter 16 ■ Up in Lights: How to Drive LED Segment Displays
entity seven_segment_top is
port(
-- Clock ins, SYS_CLK = 50MHz
SYS_CLK : in std_logic;
-- LED outs
USER_LED : out std_logic_vector(8 downto 1);
-- SPI Interface to Raspberry Pi
GPIO_01 : in std_logic; -- SPI CLOCK
GPIO_02 : in std_logic; -- SPI MOSI
GPIO_03 : in std_logic; -- SPI SLAVE SELECT (Active low)
GPIO_04 : out std_logic; -- SPI MISO
-- 7 Segment display interface
GPIO_05 : out std_logic; -- Segement Pin 7-A
GPIO_06 : out std_logic; -- Segement Pin 7-B
GPIO_07 : out std_logic; -- Segement Pin 7-C
GPIO_08 : out std_logic; -- Segement Pin 7-D
GPIO_09 : out std_logic; -- Segement Pin 7-E
GPIO_10 : out std_logic; -- Segement Pin 7-F
GPIO_11 : out std_logic -- Segement Pin 7-G
);
end entity seven_segment_top;
begin
376
Chapter 16 ■ Up in Lights: How to Drive LED Segment Displays
377
Chapter 16 ■ Up in Lights: How to Drive LED Segment Displays
You can follow the same method as we used in Chapter 15 to generate the bit file and program the FPGA
for this example design.
After the bit file is uploaded to the FPGA, the 7 segment display should start to count from 0 to 9. We can
control the counter from Raspberry PI SPI master interface.
378
Chapter 16 ■ Up in Lights: How to Drive LED Segment Displays
16.6 Summary
In this chapter, we designed a special version of the 7 segment counter. The counter module includes some
register design, a second counter and combination logic for decoding the 7 segment display. All three
elements are very basic and useful for most of the design. The seven_segment_top.vhd shows most of what
all top level designs do - connect all of the modules to the outside world.
After this chapter, you should know to handle the design flow for a FPGA design which is like the
following.
• Define clock and reset
• Define the input and output requirements
• Create the port list
• Separate the design requirements into multiple stages/steps
• Design each stage/step with one process with VHDL code
379