pjyc
Junior Member level 1
HI THERE.
I have 80Mhz clock on my system.
and we need to get 26.666Mhz from 80Mhz. (80Mhz/3 = 26.666Mhz)
Below source code is the part of 26.6Mhz clock generater.
We've got good result by simulator. but real system was no good.
Is there anybody who can suggest anyting to do about it?
thanks.
I have 80Mhz clock on my system.
and we need to get 26.666Mhz from 80Mhz. (80Mhz/3 = 26.666Mhz)
Below source code is the part of 26.6Mhz clock generater.
We've got good result by simulator. but real system was no good.
Is there anybody who can suggest anyting to do about it?
thanks.
Code:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity clk26M is
port( clk : in std_logic;
outclk : buffer std_logic);
end clk26M;
architecture p1 of clk26M is
signal count : std_logic_vector(2 downto 0);
signal div2 : std_logic;
signal div3 : std_logic;
signal dlydiv3 : std_logic;
begin
-- Divided 2
process(clk)
begin
if(clk'event and clk = '1') then
div2 <= not(div2);
end if;
end process;
-- Divided 3
process(clk)
begin
if(clk'event and clk = '1') then
if(count < 2) then
count <= count + '1';
else
div3 <= not(div3);
count <= (others => '0');
end if;
end if;
end process;
-- 1.5 step Delay
process(clk)
begin
if(clk'event and clk = '0') then
if((div2 xor div3) = '1') then
dlydiv3 <= not(dlydiv3);
end if;
end if;
end process;
outclk <= div3 xor dlydiv3;
end p1;