完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,伙计们,最近,我正在开发一个USB项目,其中CY7C68013A-128AXC被用来通过奴隶FIFO接口与FPGA通信,在68013中,EP2被配置为512字节双缓冲Mulnual OFF FIFO,EP6被配置为FIFO中的512字节双缓冲自动,IFCK来自外部的。在痛苦的调试,我看到在Slave FIFO接口很奇怪的行为:当FPGA读取数据从68013到从属FIFO接口,我们必须设置慢点fifopinpolar登记为“1”,之后,FPGA可以正确地从Slave FIFO接口无论什么价值出现读取数据S在SLLE PIN,即使驱动器0’上的SLLE引脚。否则,如果我们把莓点fifopinpolar登记为“0”,那么我们永远无法读取数据从Slave FIFO甚至我们开车慢销到“0”,在Slave FIFO数据总线就像HIGHZ状态。当FPGA数据写入68013,情况是相反的从68013读取数据。我们必须把莓点fifopinpolar登记为“零”,之后,FPGA可以正确写数据到68013不管通过什么价值Slave FIFO接口出现在慢销,即使驱动器“0”慢销。否则,如果我们把莓点fifopinpolar登记为“1”,然后我们可以不写数据到68013通过从属FIFO接口,甚至我们开车慢销0。我相信慢销连接是好的,它不是浮。以下是td_init() 68013固件,有任何错误的配置?td_init?虚空(void)//调用一次启动{ //设置CPU的时钟48mhz cpucs =((cpucs &;~ bmclkspd)| bmclkspd1);revctl = 0x03;//必须设置revctl。0和revctl。1到1 syncdelay;/ / fiforeset = 0x80;/ /激活nak-all避免竞争条件syncdelay;/ / fiforeset = 0x02;/ /复位FIFO 2 syncdelay;fiforeset = 0x06;/ /复位FIFO 6 syncdelay;/ / / / / /关闭fiforeset = 0x00;nak-all syncdelay;//设置从属FIFO接口48mhz,使用外部时钟ifconfig = 0x43;syncdelay;ep2fifocfg = 0x01;/ /手了syncdelay;ep2cfg = 0xa2;syncd时滞;ep6fifocfg = 0x09;/ / autoin syncdelay;ep6cfg = 0xe2;SYNCDELAY;/ /!!!!!!!!当外部FIFO读硕士的数据从接口,在登记fifopinpolar莓位必须设置为1,fifopinpolar = 0x10 / /!!!!!!!!当外部FIFO主数据写入从站接口,在登记fifopinpolar莓位必须设置为0,fifopinpolar = 0x00 fifopinpolar = 0x00;syncdelay;ep6autoinlenh = 0x02;/你可以定义这些如你所愿,syncdelay;/有FX2自动限制的ep6autoinlENL = 0x00;syncdelay;syncdelay;ep2bcl = 0x80;/ /手臂ep2out写字节数W /跳过。syncdelay;ep2bcl = 0x80;SYNCDELAY;//使双autopointer特征autoptrsetup | = 0x01;rwuen = true;/ /启用远程唤醒}
以上来自于百度翻译 以下为原文 hi guys, recently, I'm developing a u*** project, in which Cy7c68013A-128AXC is used to communicate with FPGA through slave fifo interface, in the 68013, EP2 is configured as 512 bytes double buffered mannual out fifo, EP6 is configured as 512 byte double buffered auto-in fifo, IFCLK is coming from external. after painful debugging, I saw very strange behavior in the slave fifo interface: when FPGA read data from 68013 through slave fifo interface, we must set the SLOE bit of FIFOPINPOLAR register to be '1', after that, FPGA can correctly read data from slave fifo interface no matter what value appears in SLOE pin, even though drive '0' on SLOE pin. otherwise, if we set the SLOE bit of FIFOPINPOLAR register to be '0', then we can never read data out from slave fifo even we drive SLOE pin to '0', the data bus on slave fifo looks like in HighZ state. when FPGA write data into 68013, the condition is contrary to read data from 68013. we must set the SLOE bit of FIFOPINPOLAR register to be '0', after that, FPGA can correctly write data into 68013 through slave fifo interface no matter what value appears in SLOE pin, even though drive '0' on SLOE pin. otherwise, if we set the SLOE bit of FIFOPINPOLAR register to be '1', then we can never write data into 68013 through slave fifo interface, even we drive SLOE pin to '0'. and I'm sure that the SLOE pin connection is ok, it's not floating. following is TD_init() in 68013 firmware, is there any wrong configuration?? void TD_Init(void) // Called once at startup { // set the CPU clock to 48MHz CPUCS = ((CPUCS & ~bmCLKSPD) | bmCLKSPD1) ; REVCTL = 0x03; // MUST set REVCTL.0 and REVCTL.1 to 1 SYNCDELAY; // FIFORESET = 0x80; // activate NAK-ALL to avoid race conditions SYNCDELAY; // FIFORESET = 0x02; // reset, FIFO 2 SYNCDELAY; FIFORESET = 0x06; // reset, FIFO 6 SYNCDELAY; // // FIFORESET = 0x00; // deactivate NAK-ALL SYNCDELAY; // set the slave FIFO interface to 48MHz, use external clock IFCONFIG = 0x43; SYNCDELAY; EP2FIFOCFG = 0x01; // mannual out SYNCDELAY; EP2CFG = 0xA2; SYNCDELAY; EP6FIFOCFG = 0x09; // autoin SYNCDELAY; EP6CFG = 0xE2; SYNCDELAY; // !!!!!! when external fifo master read data from slave interface, the SLOE bit in register FIFOPINPOLAR must set to be 1, FIFOPINPOLAR = 0x10 // !!!!!! when external fifo master write data into slave interface, the SLOE bit in register FIFOPINPOLAR must set to be 0, FIFOPINPOLAR = 0x00 FIFOPINPOLAR = 0x00; SYNCDELAY; EP6AUTOINLENH = 0x02; // you can define these as you wish, SYNCDELAY; // to have the FX2 automatically limit IN's EP6AUTOINLENL = 0x00; SYNCDELAY; SYNCDELAY; EP2BCL = 0x80; // ARM EP2OUT by writing byte count w/skip. SYNCDELAY; EP2BCL = 0x80; SYNCDELAY; // enable dual autopointer feature AUTOPTRSETUP |= 0x01; Rwuen = TRUE; // Enable remote-wakeup } |
|
相关推荐
3个回答
|
|
我建议三重检查你的臀部连接。如果FX2的FIFO数据总线驱动程序没有回应你的FPGA切换慢信号,然后慢慢的引脚必须停留在FX2。因为你需要设置fifopinpolar <;4>;1到FX2驱动FIFO数据总线,这意味着在一种销。你可以把范围扩大到慢销在FX2芯片,而不是FPGA?您需要确认的信号是切换在FX2的销。短电路中某处可以防止FPGA成功驱动FX2的黑脚低。您确定您的FX2有正确的引脚吗?你用128引脚和引脚部分,可以从不同的一百五十六销部分。您确定您使用的是FPGA的正确的引脚吗?请问你的约束文件连接内部慢信号正确输出引脚?你确定FPGA的野莓输出引脚是连接到FX2的野莓输入?
以上来自于百度翻译 以下为原文 I would suggest triple-checking your SLOE connection. If the FX2's FIFO data bus drivers do not appear to respond to your FPGA toggling the SLOE signal, then the SLOE pin must be stuck at the FX2. Given that you need to set FIFOPINPOLAR<4> to 1 to get the FX2 to drive the FIFO data bus, this means the SLOE pin is stuck at 1. Can you attach a scope to the SLOE pin at the FX2, not the FPGA? You need to verify that the signal is actually toggling at the FX2's pin. A short somewhere in the circuit could be preventing the FPGA from successfully driving the FX2's SLOE pin low. Are you sure you have the correct pinout for your FX2? You're using the 128 pin part, and the pinout can be different from the 100 and 56 pin parts. Are you sure you're using the correct pinout for your FPGA? Does your constraint file connect the internal SLOE signal to the correct output pin? Are you sure the FPGA's SLOE output pin is actually connected to the FX2's SLOE input? |
|
|
|
嗨,安得烈,谢谢你的回应。在准确地确定连接是好的,并直接探测在68013芯片中的SLLE引脚,它看起来也不错,它已经被FPGA正确驱动,68013侧的SLLE引脚可以正确切换。我别无选择,只有更换68013芯片,感谢上帝,它的工作原理。当然,68013芯片内部的缝隙电路出了问题。之后,我遇到了另一个问题,当我使用自动向外转移。在开始自动向外传输之前,我们需要跳过并拖动TelLyIn()中的缓冲区。(1)当我设置ReVCTL= 0x03时,PC不能发送大容量的数据到68013,EZ-USB控制面板将总是请求这个请求。2.在设置ReVCTL= 0x01,并在ToLLIIIT中写入OutpkTurn= 0x8x跳过和缓冲缓冲器后,EZ-USB控制面板将总是在PC 3.3中设置大量请求,在设置ReVCTL= 0x01之后,在TelLyIIT中写入EXXCBL=0x80来跳过并拖动缓冲器,EZ-USB控制面板可以发送大量输出数据。到68013。然后有一些有趣的事情:EZ-USB控制面板只发送一个数据包,但68013发送一个以上的数据包到从FIFO接口,有时发出2个包,有时3或4个包,你有什么线索或建议?Fenglei
以上来自于百度翻译 以下为原文 Hi andrew, thanks for your response. after exactly making sure that the connection is ok, and directly probe the SLOE pin in the 68013 chip, it also looks fine, it has been correctly driven by FPGA and the SLOE pin in 68013 side could correctly toggle. I have no choice but replacing the 68013 chip, thank god, it works. definitely, there is something wrong in the SLOE circuits inside the 68013 chip. after that I encountered another issue when I using AUTO OUT transfer. before starting auto-out transfer, we need to skip and arm the buffer in Toll_init() my problem is, 1.when I set REVCTL=0x03, PC can not send bulk out data to 68013, EZ-USB control panel will always pend this request. 2.after setting REVCTL=0x01, and writting OUTPKTEND=0x8x in Toll_init to SKIP and arm the buffer, EZ-USB control panel will always pend bulk out request from PC 3.after setting REVCTL=0x01, and writting EPxCBL=0x80 in Toll_init to SKIP and arm the buffer, EZ-USB control panel can send bulk out data to 68013. then there is something interesting: EZ-USB control panel send out only one packet, but 68013 send more than one packet to slave fifo interface, sometimes sends out 2 packet, sometimes 3 or 4 packets do you have any clue or suggestion? BR, Fenglei |
|
|
|
嗨,风雷,出于我不记得的原因,我不使用ReVCTL= 0x03(DynOutOUT=1和HuffyPKT=1)。我只使用HeNHYPKT=1,技术参考手册中有ReVCTL寄存器下的信息,当DyNyOUT=0时,AutoDutt位的0和GT 1的转换将导致端点变为武装(在手动Out&Gt;Auto-Out-Tochange中可能丢失任何数据)。也就是说,您不必通过写入OutpKToad或写入EXBCL来武装端点。不幸的是,如果在0和GT 1转换期间有任何数据等待您从端点缓冲器读取,那么它将消失,因为缓冲区将可用于新数据。这就是为什么他们制作DynIOUT=1。在这种情况下,必须用OutpKTead或EPXBCL武装终结点来“启动泵”。这是我在初始化FX2时所采取的一般方法。首先,设置CPUCS的时钟速度,CKCON为拉伸值,IFCOFIG为FIFO接口,然后RVCTL。在这种情况下,我设置ReVCTL=BMKIPIPOMIN,这与ReVCTL= 0x01下一个相同,我配置FIFO的USB域侧(例如,与USB主机控制器通信的一侧)。这是EPXCFG寄存器。FUI,USB域的状态寄存器是EP24FIFOFLGS和EP68 FIFOFLGS。状态位被复制到EP2468 STAT中,这在SFR空间中是很方便的。然后,我设置FiFET(记住将0x80设置为NAK全部,然后0x0x,其中x是要重置的端点,然后0x00停止NACK ALL)。我认为有一个原因,我做FippET之间配置的USB和外围领域,但它逃避我目前。接下来,我配置FIFO的外围领域(例如,与外部逻辑通信的那一方,在您的情况下是FPGA)。这是EPXFIFOFFG寄存器。该域的相应状态寄存器是EPXFIFOFLGS。非常重要的一点是自动输出(可能是自动输入?)比特需要在这里经历0和1的转变。现在,当FX2从上电复位时,这些位是0,而您通常将它们设置为1。但是,如果你做了一个热重置(例如使用CPUC寄存器的复位位),比特将保持1,并让你头痛。最后,如果有任何需要武装的端点(比如EP1,它没有自动位),我最后把它们武装起来。我可以建议比较这两个领域的状况吗?通过观察端点在两个域之间的状态去同步,可以诊断出一些问题。一个例子是外围域指示它是满的,而USB域指示它是空的;FX2将告诉USB主机控制器它没有可用的数据,而它告诉外部逻辑它没有缓冲区可用。
以上来自于百度翻译 以下为原文 Hi Fenglei, For reasons I cannot remember, I do not use REVCTL=0x03 (DYN_OUT=1 and ENH_PKT=1). I only use ENH_PKT=1 The Technical Reference Manual has information under the REVCTL register that states when DYN_OUT=0, a 0->1 transition of the AUTOOUT bit will cause the endpoint to become armed (potentially losing any data during the manual-out->auto-out transition). That is, you should NOT need to arm the endpoint by writing to OUTPKTEND or writing to EPxBCL. Unfortunately, if there was any data waiting for you to read from the Endpoint's buffer during the 0->1 transition, it will be gone because the buffer will be available for new data. That is why they made DYN_OUT=1. In this case, you must "prime the pump" by arming the endpoint with OUTPKTEND or EPxBCL. Here is the general approach that I take when initializing the FX2. First, set CPUCS for the clock speed, CKCON for the stretch value, IFCONFIG for the FIFO interface, and then REVCTL. In this case, I set REVCTL |= bmSKIPCOMMIT; This is the same as REVCTL=0x01 Next, I configure the USB Domain side of the FIFO (e.g. the side that communicates with the USB host controller). This is the EPxCFG registers. FYI, the USB Domain's status registers are EP24FIFOFLGS and EP68FIFOFLGS. The status bits are copied together into EP2468STAT, which is conveniently in SFR space. Then, I set FIFORESET (remember to set 0x80 to NAK all, then 0x0X where X is the endpoint to reset, and then 0x00 to stop NAK all). I think there's a reason I do FIFORESET between configuring the USB and Peripheral domains but it eludes me currently. Next, I configure the Peripheral Domain side of the FIFO (e.g. the side that communicates with external logic, in your case the FPGA). This is the EPxFIFOCFG registers. The corresponding status registers for this domain are EPxFIFOFLGS. Of very important note is that the AUTO-OUT (and maybe the AUTO-IN?) bits need to experience a 0->1 transition here. Now, when the FX2 comes out of Power On Reset, these bits are 0, and you normally set them to 1. However, if you do a warm reset (such as using the CPUCS register's Reset bit) the bits will stay 1 and give you a headache. Finally, if there are any endpoints left that require arming (like EP1, which doesn't have AUTO- bits), I arm them last. May I suggest comparing the status of the two domains? Some problems can be diagnosed by observing desynchronization of the endpoint's status between the two domains. One example would be the Peripheral domain indicating that it is full while the USB domain indicates that it is empty; the FX2 will tell the USB host controller that it has no data available, while it tells the external logic that it has no buffers available. |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2100 浏览 1 评论
1846 浏览 1 评论
3664 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1782 浏览 6 评论
1532 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
557浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
410浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
433浏览 2评论
379浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
905浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-19 06:48 , Processed in 1.155012 second(s), Total 79, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号