UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Newbie gdtamplaru
Newbie
4,832 Views
Registered: ‎06-26-2014

CoolRunner-II LED Blinking Program

Hello everybody,

 

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:

 

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
 
entity led_blink is
port (clock : in std_logic;
      a     : out std_logic_vector(3 downto 0)
      );
end led_blink;


architecture Behavioral of led_blink is
begin
increment: process(clock)
variable i : integer := 0;
begin
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 if;
end if;

end process increment;

end Behavioral;

 

Can someone please help me and give me an input why it doesn't blink?

 

Thanks in advance!

0 Kudos
3 Replies
Instructor
Instructor
4,825 Views
Registered: ‎08-14-2007

Re: CoolRunner-II LED Blinking Program

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?

-- Gabor
0 Kudos
Newbie gdtamplaru
Newbie
4,823 Views
Registered: ‎06-26-2014

Re: CoolRunner-II LED Blinking Program

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?
0 Kudos
Highlighted
Instructor
Instructor
4,797 Views
Registered: ‎08-14-2007

Re: CoolRunner-II LED Blinking Program


@gdtamplaru wrote:
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.

-- Gabor
0 Kudos