element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
FPGA
  • Technologies
  • More
FPGA
Blog Seven segment display controlled by Arty S7 board
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join FPGA to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: kk99
  • Date Created: 25 Sep 2018 9:30 PM Date Created
  • Views 2605 views
  • Likes 6 likes
  • Comments 1 comment
  • xilinx
  • arty s7
Related
Recommended

Seven segment display controlled by Arty S7 board

kk99
kk99
25 Sep 2018

I have a single seven segment display with common anode. This display has following symbol: FJS-5161B. Here is brief information from datasheet for this display:

image


I have created a kind of PMOD module which contains a single seven segment display, eight resistors with value 150 ohm for limit the LEDs current and pinout socket.
Here is photo of this module:

image

Here is information about connection between Pmod JD connector and seven segment display:
V15 jd[0] -> D

U12 jd[1] -> C

V13 jd[2] -> B

T12 jd[3] -> A

T13 jd[4] -> DP

R11 jd[5] -> G

T11 jd[6] -> F
U11 jd[7] -> E

image

I have used Pmod JD connector with their eight pin to direct drive of this module by Arty S7 board. I have created simple module in Verilog which allow to drive this display. Here is source code:

module display(
    input CLK100MHZ,
    input [3:0] digit,
    output [7:0] jd
    );
    
    reg [7:0] outValue;
    always @(posedge CLK100MHZ)
    begin
        case (digit)
        4'h0: outValue <= 8'b00110000;
        4'h1: outValue <= 8'b11111001;
        4'h2: outValue <= 8'b01010010;
        4'h3: outValue <= 8'b11010000;
        4'h4: outValue <= 8'b10011001;
        4'h5: outValue <= 8'b10010100;
        4'h6: outValue <= 8'b00010100;
        4'h7: outValue <= 8'b11110001;
        4'h8: outValue <= 8'b00010000;
        4'h9: outValue <= 8'b10010000;
        default: outValue <= 8'b11111111;
        endcase
    end
    
    assign jd = outValue;
endmodule

We have here a simple conversion of input digit stored at 4 bits to 8 bits output register which drives output JD pins. Here is source of main design for test this module:

module top(
    input CLK100MHZ,
    output [7:0] jd
    );
    
    reg [3:0] digit = 0;
    display display(
        .CLK100MHZ(CLK100MHZ),
        .digit(digit),
        .jd(jd)
    );
    
    reg [32:0] countReg = 0;
    always @(posedge CLK100MHZ) begin
        if (countReg < 99999999) begin
            countReg <= countReg + 1;
        end else begin
            countReg <= 0;
            if (digit < 9)
                digit <= digit + 1;
            else
                digit <= 0;
        end
    end
    
endmodule

We have here simple prescaler of source 100 MHz clock. So, in each second we are able to see a different digit on display.

Here is short video presentation of a working display:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Below there is small the same code of display with support for dot point and basic brightness regulation with 15 levels:

`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: 
// Engineer: 
// 
// Create Date: 22.09.2018 23:43:36
// Design Name: kk99
// Module Name: display
// Project Name: 
// Target Devices: 
// Tool Versions: 
// Description: 
// 
// Dependencies: 
// 
// Revision:
// Revision 0.02 - File Created
// Additional Comments:
// 
//////////////////////////////////////////////////////////////////////////////////


module display(
    input CLK100MHZ,
    input [3:0] digit,
    input dotPoint,
    input [3:0] pulseDuration,
    output [7:0] jd
    );
    
    reg [3:0] pulseStep = 0;
    reg [7:0] outValue;
    always @(posedge CLK100MHZ) begin
        if (pulseStep < pulseDuration) begin
            pulseStep <= pulseStep + 1;
            if (dotPoint) begin
                case (digit)
                4'h0: outValue <= 8'b00100000;
                4'h1: outValue <= 8'b11101001;
                4'h2: outValue <= 8'b01000010;
                4'h3: outValue <= 8'b11000000;
                4'h4: outValue <= 8'b10001001;
                4'h5: outValue <= 8'b10000100;
                4'h6: outValue <= 8'b00000100;
                4'h7: outValue <= 8'b11100001;
                4'h8: outValue <= 8'b00000000;
                4'h9: outValue <= 8'b10000000;
                default: outValue <= 8'b11101111;
                endcase
            end else begin
                case (digit)
                4'h0: outValue <= 8'b00110000;
                4'h1: outValue <= 8'b11111001;
                4'h2: outValue <= 8'b01010010;
                4'h3: outValue <= 8'b11010000;
                4'h4: outValue <= 8'b10011001;
                4'h5: outValue <= 8'b10010100;
                4'h6: outValue <= 8'b00010100;
                4'h7: outValue <= 8'b11110001;
                4'h8: outValue <= 8'b00010000;
                4'h9: outValue <= 8'b10010000;
                default: outValue <= 8'b11111111;
                endcase
            end
        end else begin
            pulseStep <= 0;
            outValue <= 8'b11111111;
        end
    end
    
    assign jd = outValue;
endmodule


Here is source of main design with basic demo of seven segment display. We are able to change brightness by 4 switch buttons sw[3:0] with following levels: 15,11,7,3. The default brightness level is set to 1.

`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: 
// Engineer: 
// 
// Create Date: 25.09.2018 21:02:57
// Design Name: 
// Module Name: top
// Project Name: 
// Target Devices: 
// Tool Versions: 
// Description: 
// 
// Dependencies: 
// 
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
// 
//////////////////////////////////////////////////////////////////////////////////


module top(
    input CLK100MHZ,
    input [3:0] sw,
    output [7:0] jd
    );
    
    reg [3:0] digit = 0;
    reg dot = 1;
    reg [3:0] pulseValue = 0;
    display display(
        .CLK100MHZ(CLK100MHZ),
        .digit(digit),
        .dotPoint(dot),
        .pulseDuration(pulseValue),
        .jd(jd)
    );
    
    reg [32:0] countReg = 0;
    always @(posedge CLK100MHZ) begin
        if (countReg < 99999999) begin
            countReg <= countReg + 1;
        end else begin
            countReg <= 0;
            if (digit < 9) begin
                digit <= digit + 1;
                dot <= 0;
            end else begin
                digit <= 0;
                dot <= 1;
           end
        end
        if (sw[3])
            pulseValue <= 15;
        else if (sw[2])
            pulseValue <= 11;
        else if (sw[1])
            pulseValue <= 7;
        else if (sw[0])
            pulseValue <= 3;
        else
            pulseValue <= 1;
    end
    
endmodule

 

Here is short video presentation of second version of display module:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

  • Sign in to reply

Top Comments

  • bhfletcher
    bhfletcher over 5 years ago +1
    Linking to where you can buy the Arty-S7 50 board with the XC7S50-CSGA324 device. Arty-S7-50 Arty-S7-50
  • bhfletcher
    bhfletcher over 5 years ago

    Linking to where you can buy the Arty-S7 50 board with the XC7S50-CSGA324 device.

    Arty-S7-50Arty-S7-50

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube