Forum Discussion

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

ADC code for Cyclone II DE1 board not working

Hi, i wrote the following code to read digital values from the pins of ADC0804 but it doesnt seem to be working...

library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_arith.all;

use ieee.std_logic_unsigned.all;

library std;

use std.standard;

ENTITY ADC IS

PORT( CLK : IN STD_LOGIC;

IN_0 : IN STD_LOGIC;--LSB

IN_1 : IN STD_LOGIC;

IN_2 : IN STD_LOGIC;

IN_3 : IN STD_LOGIC;

IN_4 : IN STD_LOGIC;

IN_5 : IN STD_LOGIC;

IN_6 : IN STD_LOGIC;

IN_7 : IN STD_LOGIC;--MSB

ADC_OUT : OUT STD_LOGIC_VECTOR(7 DOWNTO 0));

END ADC;

----------------------------------------------------------------

ARCHITECTURE a OF ADC IS

SIGNAL ADC_IN : STD_LOGIC_VECTOR(7 DOWNTO 0);

BEGIN

ADC_IN <= IN_7&IN_6&IN_5&IN_4&IN_3&IN_2&IN_1&IN_0;

PROCESS(CLK)

BEGIN

IF (CLK'EVENT AND CLK='1') THEN

ADC_OUT <= NOT(ADC_IN);

END IF;

END Process;

end a;

I tested this code using an 8 bit random number generator and it works fine, but when the cyclone II board is connected directly to the ADC0804, i get no output. The ADC is working fine(tested using array of LEDs)....

What am i doing wrong? please help me guys, this is urgent :(

or is it because of logic voltage levels? ADC0804 = 5V and 0V... Cyclone II FPGA = 3.3V and 0V...

ADC0804 is TTL compatible

Regards

Dante

15 Replies