USB low-full-high speed peripherals Forum Discussions
text.format{('custom.tabs.no.results')}
Hi,
My question is respect to the timing diagrams provided in section 9.6 of the Cypress CY7C68013 FX2 datasheet. Basically, for an internally sourced 48MHz IFCLK, are the numbers and picture with respect to IFCLK inside the device, or are they measured at the pin.
The reason I'm asking is that probing at the output pins of the FX2 I see that for example that the CTLx output is actually driven several nanosections *before* the rising edge at the IFCLK pin. IFCLK is not configured to be inverted and the number is no where near the spec'ed max clock to out of 6.7ns. Same issue with the GPIF address and the data lines.
Can anyone provide any clarity? Thanks,
Raphael
Show LessHi there,
I am trying to transfer large files(larger than 1MB) with fx2lp. Actually, I just followed AN61345(Implementing an FX2LP™-FPGA Interface). It worked well on EZ-USB console, 512 bytes send to ep2, 512 bytes back to ep6.
Then I made a app with VC6. Divide the large file to 512 bytes packets, and transfer them via Xferdata() fuction. The code is
for(i=0;i<pcount;i++)
{
for(j=0;j<buf_size;j++){usb_i
if(USBDevice->BulkOutEndPt)
i_finish=USBDevice->BulkOutEndPt->XferData(usb_i,buf_size);
if(USBDevice->BulkInEndPt)
o_finish=USBDevice->BulkInEndPt->XferData(usb_o,buf_size);
for(j=0;j<buf_size;j++) {sig_o[buf_size*i+j]=usb_o
}
When the files are small(<20kB), it works well. Every step ep6 become empty when the data is read by host.
If the file is larger, as the process continus, ep6 will not be empty sometime and all the followed data is error code(always CD).
I am using cy3684_kit_15, hope someone help me to find the reason or give some advice.
Thanks!
Show LessHi-
I'm working with an FX2LP EZ-USB development kit. I'm using VS2010 in an MFC C++ project, via cyapi.lib. I have a question about XFerData() on a Bulk Endpoint. I have a tight loop that reads single bytes from an in endpoint. I have set the timeout to '0' and I sometimes get a "false" return code, but the "bufLen" variable shows that data was returned. The lastError value is set to 997 (ERROR_IO_PENDING). My question is "What IO is pending?". I have other things to do in the loop, so I would just like to see if the data is ready to be sent upstream to the PC. I expected either a false with bufLen set to '0', or true with a non-zero bufLen. I don't know how to interpret the mixed case. The buffer I supplied is 512 bytes big, and I set bufLen to 512 before I make the call. Below is a simple portion of the code.
I have not looked at this at a hardware level yet, as it seems like the data does come across. The hardware is set to send up 1 or 2 byte packets.
unsigned char inStatusBuff[512];
...
m_StatusInEndpt->TimeOut = 0;
bool bSuccess = false;
char
while (!m_bClosing) {
...
lCount = 512;
//m_StatusInEndpt is a Bulk In Endpoint
bSuccess = m_StatusInEndpt->XferData(inStatusBuff,lCount);
m_StatusInEndpt->LastError;
if(!bSuccess && lCount != 0)
{
m_ErrorCount++;
CString strError;
strError.Format("Error code: %d\r\n",m_StatusInEndpt->LastError);
m_printf(strError);
}
...
}
Show LessHello,everyone!
I am using GPIF write waveform to send less than 512 bytes data block.
I referenced Knowledge Base Article "NextData/ActivateData in the GPIF read Waveform Interval".
In this paper,
In order to write data from the FIFO to the external peripheral, you will do an activate data first in one interval. Doing this will result in driving the first byte in the FIFO on to the GPIF data bus and then you may do a Next FIFO Data on the subsequent interval. Doing an Activate Data and a Next FIFO Data on the same interval will result in incrementing the FIFO pointer and driving the new data (pointed to by the incremented pointer) and should be done in subsequent intervals. Therefore a Next FIFO Data is required in case of GPIF Write
I activated data first in one interval(Same Data),and Next FIFO Data on the subsequent interval.
I writed 256 bytes “0x00, 0x01,…, 0xFF”,but read data is 258 bytes “0x00, 0x01,…, 0xFF,0xFE, 0xFF”.
So , last 2 byte in the FIFO,” 0xFE ,0xFF” repeated.
What is the reason?
The source code is as following.
// we are just using the default values, yes this is not necessary...
TD_INIT()
{
EP2CFG = 0xA2; // double buffer,bulk
SYNCDELAY;
…
EP2FIFOCFG = 0x15; //00010101 : AUTOOUT=1, ZEROLEN=1, WORDWIDE=1
EP2AUTOINLENH = 0x02; // When AUTOOUT=1, core commits IN data
SYNCDELAY;
EP2AUTOINLENL = 0x00; // ...when EPxAUTOINLEN value is met
SYNCDELAY;
EP2GPIFFLGSEL = 0x01; // FiFo empty Flag
…
}
void TD_Poll(void) // Called repeatedly while the device is idle
{
if( GPIFTRIG & 0x80 ) // GPIF is Idle
{
if(!(EP2468STAT & bmEP2EMPTY))
{
GPIFTRIG = GPIFTRIGWR | GPIF_EP2;
}
…
}
}
In Waveform, I repeated “Next FIFO Data on the subsequent interval” until EP2GPIFFLG empty.
Show LessIn AN63787 http://www.cypress.com/?docID=34260, it describes how to source and commit an packet by GPIF manual IN mode.
It set the GPIFTCB to be 512, which is the max bytes of its EP6FIFOBUF. But how can we source and commit more than 512 bytes data by GPIF manual IN?
Show LessDoes anyone know if CCyUSBDevice is thread safe?
For instance, can I call XFerData() on two different endpoints from the same CCyUSBDevice from two separate threads at the same time?
Show LessIn my application software,why after I download the firmware the transfers are all failed?
in my application software, I download the firmware on the software running. but after that all the transfers can't sucess. but if I download the firmware with Cyconsole.exe. The transfers run well.
how to solve the problem?
Show LessI read 153600-byte data from external FIFO using GPIF FIFO read mode.
And now I want to modify my 76800-77024 (1024 bytes) data into 0xFF.
The problem is that the new data will fresh EPxFIFOBUF. And I can't pause the GPIF to have enough time to process my old data.
Is it possible to finish this task?
Show Less