Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

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

RPALO3
Beginner
3,987 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
3,746 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:

 

0 Kudos
RPALO3
Beginner
3,746 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
0 Kudos
Reply