Forum Discussion
Altera_Forum
Honored Contributor
14 years agointerface ADC0804 with CPLD
Hello Folks, I am trying to interface the ADC0804, 8-bit output to 8 input pins of a CPLD. I intend to provide 1MHz clock frequency to the ADC and use a system clock for the CPLD at a lower freque...
Altera_Forum
Honored Contributor
14 years agoThat... will not work.
What you have can be summarized as (in a cleaner way)clk_out <= not clk_in;
process(clk_out)
begin
if(clk_out'event and clk_out='1') then
count <=count+1;
if(count = 5) then
clk <= not clk;
count <= 1;
-- cs <= '0'; -- overriden
-- wr<='0'; -- overriden
wr<='0';
cs<='1';
if(intr = '0') then
flag <= '1';
end if;
end if;
end if;
end process; Don't abuse "buffer". Use "in", "out" and "inout" as needed. You mention that you want 1 MHz for the ADC and 500 kHz for the CPLD, but in your code, logic is running in the (negated) input clock, not in the divided by 2 "clk".