Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12455 Discussions

How to write code of seven segment display using Nios ii in eclipse?

RPALO3
Beginner
1,065 Views

I want to use the i2c protocol for implementing the seven segment display in max10 Board.can anyone one help in sending any reference code of this

0 Kudos
3 Replies
Ahmed_H_Intel1
Employee
824 Views

Hi,

There is no certain example of displaying a seven segment display with NIOS but it is a very simple example.

You can create an RTL code to get the value from NIOS and then translate it to 7 segment display. The NIOS can send the seven segment value to the following circuit and the value will be displayed as seven segment.

always @* begin case(seven_seg_val) 4'b0000: LED_out = 7'b0000001; // "0" 4'b0001: LED_out = 7'b1001111; // "1" 4'b0010: LED_out = 7'b0010010; // "2" 4'b0011: LED_out = 7'b0000110; // "3" 4'b0100: LED_out = 7'b1001100; // "4" 4'b0101: LED_out = 7'b0100100; // "5" 4'b0110: LED_out = 7'b0100000; // "6" 4'b0111: LED_out = 7'b0001111; // "7" 4'b1000: LED_out = 7'b0000000; // "8" 4'b1001: LED_out = 7'b0000100; // "9" default: LED_out = 7'b0000001; // "0" endcase   end

 

another option is to this into the C/C++ code by using switch case for example to translate the value to 7-seg

There are many examples online you can find like the following:

 

RPALO3
Beginner
824 Views
Hii sir, can you send some link which could be helpful for me. Can you send the process how to proceed . Actually first time working with nios ii. So unable to figure out. Thank you Ritu
Ahmed_H_Intel1
Employee
824 Views
Reply