Connect with us

Digital Tachometer VHDL

Discussion in 'General Electronics Discussion' started by tachometer, Mar 25, 2012.

Scroll to continue with content
  1. tachometer

    tachometer

    14
    0
    Mar 25, 2012
    When I was finally satisfied with my project i got into this huge error I've spent all day trying to debug but I just cant.
    In model sim everything works just fine but when i try to synthesize it what happens is that i get this error :
    ERROR:Xst:827 Signal PUSHBUTTON cannot be synthesized, bad synchronous description. The description style you are using to describe a synchronous element (register, memory, etc.) is not supported in the current software release.

    This is the code for the entity:
    entity clkdiv is
    port (
    CLK: in std_logic;
    CLKOUT: out std_logic;
    PB : in std_logic
    );
    end clkdiv;

    architecture Behavioral of clkdiv is


    signal MAXCOUNT: std_logic_vector (22 downto 0):= "00000000001010101111100";
    signal COUNT: std_logic_vector (22 downto 0):= (others =>'0');
    begin
    process(CLK, PB)
    variable PUSHBUTTON: integer;
    begin


    if (PB='1')then
    PUSHBUTTON:= 1;
    end if;
    if (PUSHBUTTON = 1) then
    if(rising_edge (CLK)) then
    if(COUNT < MAXCOUNT ) then
    COUNT <= COUNT+1;
    CLKOUT <= '1';
    elsif (COUNT=MAXCOUNT) then
    COUNT <= (others => '0');
    CLKOUT <= '0';
    PUSHBUTTON:=0;
    end if;
    end if;
    elsif (PUSHBUTTON = 0) then
    COUNT <= (others => '0');
    CLKOUT <= '0';
    end if;
    end process;
    end Behavioral;
     
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    10,025
    2,138
    Nov 17, 2011
    A pushbutton should Not be modeled aƟ an integer. It hast only 2 states: on and off. Use Standard logic instead.
    Harald
     
  3. tachometer

    tachometer

    14
    0
    Mar 25, 2012
    Final result:


    Thanks :)
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

ā€œā€

-