Forum Discussion
Altera_Forum
Honored Contributor
15 years agoUSB fT245 max II
HI, im working with Max II . it has a CPLD and an device usb the FT245, do anybody have worked with that?, i did an example with labview and VHDL, i can communicate with pc, but the signal TXE doesnt...
Altera_Forum
Honored Contributor
15 years agoi have already read all datasheet, the device works with TXE and WR, this is my program
-- usb_ft245.vhd -- 09/05/011 -- J.C. Hdz De Torres LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; ENTITY usb_ft245 IS PORT( clk : IN STD_LOGIC;---------- contador data_port: INOUT STD_LOGIC_VECTOR(7 DOWNTO 0); INPUTS: IN STD_LOGIC_VECTOR(7 DOWNTO 0); OUTPUTS: OUT STD_LOGIC_VECTOR(7 DOWNTO 0); LECTURA: IN STD_LOGIC; A: IN STD_LOGIC; RD: OUT STD_LOGIC; WR: OUT STD_LOGIC; RXF: IN STD_LOGIC; TXE: IN STD_LOGIC); END usb_ft245; ARCHITECTURE usb_driver OF usb_ft245 IS SIGNAL data_in : STD_LOGIC_VECTOR(7 DOWNTO 0); SIGNAL data_out : STD_LOGIC_VECTOR(7 DOWNTO 0); SIGNAL read_or_write : STD_LOGIC; --------señales del contador------------------------ SIGNAL contador_periodo : STD_LOGIC_VECTOR(16 DOWNTO 0); SIGNAL lectura_signal : STD_LOGIC; BEGIN PROCESS BEGIN WAIT UNTIL(clk'EVENT) AND (clk='1'); --the antity is ready to send a byte. --Find out if the ft245 is ready to receive a byte ---IF (LECTURA = '1') THEN WR <= '0'; IF (TXE = '0') THEN -- to send data from the peripheral to the host IF (LECTURA = '1') THEN---------------------------------------------------- data_in <= INPUTS; ---carga los datos en e host data_port <= data_in; IF(contador_periodo >= 10 AND contador_periodo < 15) THEN WR <= '1'; ELSE WR <= '0'; END IF; --Reset del contador IF (contador_periodo = (23)) THEN contador_periodo <= "00000000000000000"; ELSE contador_periodo <= contador_periodo + 1; END IF; else-------------------- data_port<="ZZZZZZZZ";-------------------------- END IF; END IF; END PROCESS; END usb_driver; but the signal TXE doesnt seem to datasheet , it has something like noise, the yellow signal is TXE, WR is blue http://www.alteraforum.com/forum/attachment.php?attachmentid=4552&stc=1&d=1313505805