Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

cubic cyclonium-LED matrix interface

Hi,

Can any1 help me out interfacin LED matrix with the UP3 board.

There was a board provided by altera cubic cyclonium board which had LED matrix interface with it so can any1 please get me that verilog code.

Thanx in advance.

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    This is the code that was supplied with the Cubic Cyclonium (LED matrix driver) in a hardware tutorial class. Very simple, just copies the bit across the whole row. For example, if LEDS(0) is high, it turns on the entire top row of the LED matrix.

    library ieee;

    use ieee.std_logic_1164.all;

    use ieee.numeric_std.all;

    entity LED_DRIVER is

    port (

    clock : IN std_logic;

    resetN : IN std_logic;

    LEDS : IN std_logic_vector(7 downto 0);

    LED_MATRIX : OUT std_logic_vector(28 downto 0)

    );

    END LED_DRIVER;

    architecture rtl of LED_DRIVER is

    SIGNAL COUNTER : unsigned(15 downto 0);

    SIGNAL SCANNER : unsigned(20 downto 0);

    BEGIN

    LED_MATRIX(28 downto 8) <= std_logic_vector(SCANNER);

    LED_MATRIX(7 downto 0) <= NOT LEDS;

    process(clock,resetN)

    begin

    if resetN = '0' then

    COUNTER <= (others => '0');

    SCANNER <= to_unsigned(1,21);

    elsif clock = '1' and clock'event then

    COUNTER <= COUNTER + 1;

    if COUNTER = to_unsigned(0,16) then

    SCANNER(20 downto 1) <= SCANNER(19 downto 0);

    SCANNER(0) <= SCANNER(20);

    else

    SCANNER <= SCANNER;

    end if;

    end if;

    end process;

    END rtl;
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanx man,this will surely get me out of the hell.

    This is for stationary display can u please get me code for scrolling display.

    Refrence verilog code will also do of even 5X7 LED matrix.(Not necessary to be of cubic cyclonium ).

    I wud be glad to get logic from u.

    Thanx in advance.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Sorry, thats all I have. I got this from a set of files used for a hardware tutorial.

    This is just a guess, but I'd say the scolling display was driven from a NIOS (soft processor) inside the FPGA along with the driver I sent you. - good luck