06-26-2014 03:45 PM
I am a novice in VHDL programming so please bear with me.
I have a CoolRunner II XC2C256-7TQG144C and I am trying to make one of the 4 LEDs blink. I am using ISE 13 with a WebPack licence.
After some research I found the following code snippet which only lights up the LED, without making it blink:
entity led_blink is
port (clock : in std_logic;
a : out std_logic_vector(3 downto 0)
architecture Behavioral of led_blink is
variable i : integer := 0;
if (clock'event and clock = '1') then
if (i <= 50000000) then
i := i + 1;
a <= "1111";
elsif (i > 50000000 and i < 100000000) then
i := i + 1;
a <= "0000";
elsif (i = 100000000) then
i := 0;
end process increment;
Can someone please help me and give me an input why it doesn't blink?
Thanks in advance!
06-26-2014 06:54 PM
The code looks like it's trying to make all 4 LED's blink, assuming the pins are properly assigned. Are you sure that your pin locations are correct for your board? i.e. "clock" is on a pin actually supplied with a clock, and "a" maps to the four LED pins?
06-26-2014 07:21 PM
06-27-2014 07:31 AM
Thanks for your response.
You're right, after some testing I found out that when setting the pins correctly, all 4 of them light up and stay on.
Wait, did you say that I have to assign a pin for 'clock'? How do I know which one?
The one with the clock signal going to it. Is this a Xilinx eval board? Those usually come with a UCF file, as well as documentation on how to use each feature of the board. You should also be able to access the schematics for these boards.