阅读:3367回复:5
68013+fpga的问题
各位,请教一个问题啊
我的是使用fpga和68013连接准备使用fpga产生数据通过68013发到pc机上 68013的固件使用的是开发包中自带的slave fifo模式ep2,ep4:auto out;ep6,ep8:auto in 目前fpga程序没下载进去之前68013正常 但fpga程序一下载之后68013和pc的连接就断开了 这是为什么啊? 我的fpga程序使用了ep6来传入数据 FLAGC用来指示EP6是否写满 附fpga的vhdl代码 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity test_usb is port( --for test rst : in std_logic; sys_clk : in std_logic; write : in std_logic; led : out std_logic_vector(5 downto 0); test_work : out std_logic; --usb interface IFCLK : out std_logic; FLAGA : in std_logic; FLAGB : in std_logic; FLAGC : in std_logic; FLAGD : in std_logic; --FLAGD : inout std_logic; SLOE : out std_logic; SLRD : out std_logic; SLWR : out std_logic; PKTEND : out std_logic; --FD : inout std_logic_vector(15 downto 0); FD : inout std_logic_vector(7 downto 0); FIFOADDR : out std_logic_vector(1 downto 0) ); end test_usb; ----------------------------------------------------------------------------------------------------- --usb ep8 architecture rtl of test_usb is type statetype is (idle,cyidle, cywrs1, cywrs2, cywrs3,cywrs4); signal present_state : statetype; signal temp_clk:std_logic; signal count:std_logic_vector(7 downto 0):=(others=>\'0\'); signal data_temp:std_logic_vector(12 downto 0):=(others=>\'0\'); begin process(sys_clk) begin if(rising_edge(sys_clk))then temp_clk<=not temp_clk; end if; end process; process(temp_clk,present_state) begin if(rising_edge(temp_clk))then if(rst=\'0\')then count <=\"00000000\"; data_temp<=(others=>\'0\'); present_state<=idle; else case present_state is when idle => SLOE <=\'1\'; SLRD <=\'1\'; SLWR <=\'1\'; PKTEND <=\'1\'; FD <=\"11111111\"; led<=\"111111\"; FD<=\"ZZZZZZZZ\"; if ( write=\'1\') then FD<=count; present_state <=cyidle; else present_state <= idle; end if; when cyidle => led<=\"111110\"; SLWR <=\'1\'; FIFOADDR <=\"10\"; PKTEND <=\'1\'; present_state <=cywrs1; when cywrs1 => FIFOADDR <=\"10\"; led<=\"111101\"; present_state <=cywrs2; when cywrs2 => led<=\"111100\"; SLWR<=\'1\'; if(FLAGC=\'1\') then PKTEND <=\'1\'; present_state <=cywrs3; else present_state<=cywrs2; end if; when cywrs3 => count <=count+1; data_temp<=data_temp+1; led<=\"111011\"; PKTEND <=\'1\'; FD<=count; SLWR <=\'0\'; present_state <=cywrs4; when cywrs4 => led<=\"111010\"; PKTEND <=\'1\'; SLWR <=\'1\'; FD<=\"ZZZZZZZZ\"; if (WRITE=\'1\') then present_state <=cywrs1; else PKTEND <=\'1\'; present_state <= idle; end if; when others => null; end case; end if; end if; end process; test_work<=temp_clk; IFCLK<=\'0\'; end rtl; |
|
沙发#
发布于:2005-04-30 14:02
你要把FPGA的两个I/O管脚和68013的RESET#和WAKEUP#相连,
然后在代码里添加两个输出信号: USB_RESET <= \'1\'; USB_WAKEUP <= \'1\'; 防止在下载FPGA代码后因为这两个管脚状态不确定导致 68013的重启,进而丢失连接。 |
|
板凳#
发布于:2005-04-30 15:29
那两个引脚应该没什么问题的
我的固件采用的是开发包自带的C:\\\\Cypress\\\\Examples\\\\Examples\\\\FX2 Slave FIFO\\\\FX2 Slave FIFO,其配置如下: It configures FX2 as follows: 01). EP2 512 2x BULK OUT - 8-bit async AUTO mode 02). EP4 512 2x BULK OUT - 8-bit async AUTO mode 03). EP6 512 2x BULK IN - 8-bit async AUTO mode 04). EP8 512 2x BULK IN - 8-bit async AUTO mode 05). FIFO strobes and flags are all active low 06). FLAGA - fixed EP2EF 07). FLAGB - fixed EP4EF 08). FLAGC - fixed EP6FF 09). FLAGD - fixed EP8FF 10). SLCS isn't being used 11). FX2 can't signal zerolen OUT token to the master 目前程序下载进去的时候还好,但是只要我一启动fpga写数据,然后68013和pc的连接就断开了 control panel上出现如下信息: Abort Pipe: Pipe=2 Read IOCTL failed 连到系统上的设备没有发挥作用。 我的fpga的大致工作是: 选中ep6,当fpga开始工作,FIFOADDR=10,PKTEND=1 然后产生SLWR信号来往EP2中写数据 我的写的时序如下图:(使用异步模式) 目前我有些没弄明白 如果我的端点设的是auto模式,是不是在TD_Poll中不用做任何工作 我只要控制外部的fpga选中对应的端点产生SLWR信号,同时通过FD输出数据 数据就可以由68013自动送到pc上面,然后我使用control panel就可以将数据读进去了? |
|
地板#
发布于:2005-05-01 14:09
前面的问题解决了
是我的68013-56的reserved pin没接地的原因 固件和fpga的逻辑都没什么问题 现在可以使用control panel接收数据了 不过传输中会基本上每16个就会丢一个数据 数据丢的也太多了点吧? 我使用的autoin 怎么解决这个问题啊? |
|
地下室#
发布于:2005-05-04 20:23
greenling 大虾 能不能把你的固件程序 装载驱程 设备驱程发给我啊 jacklvabcd@163.com
感谢万分!!! |
|
5楼#
发布于:2005-05-07 00:30
能不能把你的硬件接口说明一下,或者发给我一下,谢谢!liaotao_121@126.com
[编辑 - 5/7/05 by caibo_bupt] |
|