Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21324 Discussions

Wrong value from 7 segment display

Altera_Forum
Honored Contributor II
1,518 Views

Hello, I am a newbie here using Cyclone II FPGA starter dev board. I am trying to program (VHDL) the 7-segment displays on the FPGA starter board to display 4 digits value. Therefore the result is not what I want and it is weird. Can anybody help? Thankyou~ 

 

Code: 

LIBRARY ieee; 

USE ieee.std_logic_1164.all; 

 

ENTITY test IS 

PORT( HEX0,HEX1,HEX2,HEX3 :OUT STD_LOGIC_VECTOR (6 DOWNTO 0)); 

end test; 

 

architecture Behavior of test is 

begin 

HEX0 <="0001000" ; 

HEX1 <="0001000" ; 

HEX2 <="0001000" ; 

HEX3 <="0001000" ; 

 

END Behavior; 

 

the result is weird, "0010000" "0000000" "0000000" "0000000" respectively.:confused:
0 Kudos
7 Replies
Altera_Forum
Honored Contributor II
767 Views

Sounds unlikely. Are you sure about a correct pin definition?

0 Kudos
Altera_Forum
Honored Contributor II
767 Views

Sorry, what do you mean by pin defination?

0 Kudos
Altera_Forum
Honored Contributor II
767 Views

Location assignments. Simply check the pinout report for correct locations of all HEX output signals.

0 Kudos
Altera_Forum
Honored Contributor II
767 Views

no, I am not sure, I am completely comfused about that. I've tried similar code in verilog before, using assignments simple to HEX0 to HEX3 and it works. But in VHDl,I don't know how to fix this.  

How to check the pinout report? I've never seen it before...
0 Kudos
Altera_Forum
Honored Contributor II
767 Views

I found the .pin file and looked at it, it just shows location of pins, I still don't know where my problem is.Could you help me and have a look at it?

0 Kudos
Altera_Forum
Honored Contributor II
767 Views

The code is correct so far. You either should have copied pin location assignments from another Dev. Kits example design or entered it on your own. I can't know about. 

 

As as result, th edesign should use the below location assignments. Can you verify them in the *.pin file? 

set_location_assignment PIN_J2 -to HEX0 set_location_assignment PIN_J1 -to HEX0 set_location_assignment PIN_H2 -to HEX0 set_location_assignment PIN_H1 -to HEX0 set_location_assignment PIN_F2 -to HEX0 set_location_assignment PIN_F1 -to HEX0 set_location_assignment PIN_E2 -to HEX0 set_location_assignment PIN_E1 -to HEX1 set_location_assignment PIN_H6 -to HEX1 set_location_assignment PIN_H5 -to HEX1 set_location_assignment PIN_H4 -to HEX1 set_location_assignment PIN_G3 -to HEX1 set_location_assignment PIN_D2 -to HEX1 set_location_assignment PIN_D1 -to HEX1 set_location_assignment PIN_G5 -to HEX2 set_location_assignment PIN_G6 -to HEX2 set_location_assignment PIN_C2 -to HEX2 set_location_assignment PIN_C1 -to HEX2 set_location_assignment PIN_E3 -to HEX2 set_location_assignment PIN_E4 -to HEX2 set_location_assignment PIN_D3 -to HEX2 set_location_assignment PIN_F4 -to HEX3 set_location_assignment PIN_D5 -to HEX3 set_location_assignment PIN_D6 -to HEX3 set_location_assignment PIN_J4 -to HEX3 set_location_assignment PIN_L8 -to HEX3 set_location_assignment PIN_F3 -to HEX3 set_location_assignment PIN_D4 -to HEX3
0 Kudos
Altera_Forum
Honored Contributor II
767 Views

It works!Thanks!

0 Kudos
Reply