Frequency divider with clk en.

Discussion in 'VHDL' started by chema15, Aug 12, 2008.

  1. chema15

    chema15

    Joined:
    Jul 21, 2008
    Messages:
    2
    want to make a frequency divider (50 Mhz to any value, 560khz ), I am working with a counter like a freq. divider but there is a warning in Quartus II:

    Warning: Found 1 node(s) in clock paths which may be acting as ripple and/or gated clocks -- node(s) analyzed as buffer(s) resulting in clock skew

    I read that using a CLK EN is the best way to make a freq. divider, but a I don't know nothing about it, DO YOU HAVE INFORMATION OR EXAMPLES ABOUT? HELP ME PLEASE
     
    chema15, Aug 12, 2008
    #1
    1. Advertising

  2. chema15

    jeppe

    Joined:
    Mar 10, 2008
    Messages:
    348
    Location:
    Denmark
    How to avoid clockskew

    Hopefully will this appear useful:
    your welcome¨
    Jeppe

    PHP:
    entity Freqency_divider is
        Port 
    (     Clkin in  STD_LOGIC;
                    
    Clkout inout  STD_LOGIC := '0');
    end Freqency_divider;

    -- 
    How to avoid clockskew in logic designs
    architecture Behavioral of Freqency_divider is
        signal Enable
    std_logic;
    begin
        process
    (Clkin)-- All processes should use the same clock
            variable Scale_counter
    integer range 0 to 2000000;
        
    begin
            
    if rising_edge(Clkinthen
                
    if Scale_counter 1500000 then -- Random value
                    Scale_counter 
    := Scale_counter+1;
                    
    Enable <= '0';
                else
                    
    Scale_counter := 0;
                    
    Enable <= '1';        -- Must only be '1' for one clkin cycle
                end 
    if;
            
    end if;
        
    end process;
        
        
    process(Clkin)        -- All processes should use the same clock
        begin
            
    if rising_edgeClkinthen
                
    if Enable='1' then            -- heres the "trick"
                    
    Clkout <= not Clkout;    -- Do something
                end 
    if;
            
    end if;
        
    end process;

    end Behavioral;
     
    jeppe, Aug 13, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Schmigz

    clk divider

    Schmigz, Feb 9, 2004, in forum: VHDL
    Replies:
    7
    Views:
    5,830
  2. Patrick

    Frequency divider

    Patrick, May 17, 2004, in forum: VHDL
    Replies:
    6
    Views:
    4,760
    Charles Bailey
    May 21, 2004
  3. Winfried Salomon
    Replies:
    12
    Views:
    11,413
    tsachg
    Aug 29, 2007
  4. Matt Clement

    MCU clock divider vs. VHDL divider

    Matt Clement, Apr 20, 2006, in forum: VHDL
    Replies:
    3
    Views:
    4,285
    Marcus Harnisch
    Apr 28, 2006
  5. sunshinekisses@gmail.com

    with clk'event, must we use clk='1' or clk='0' ?

    sunshinekisses@gmail.com, Jul 28, 2007, in forum: VHDL
    Replies:
    18
    Views:
    6,732
Loading...

Share This Page