- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I am trying to use CY7C68013A to transfer data from DAC to PC. The rare of my DAC is 5M SPS(Samping Per Second) and the data is 8bits. The 5MHz acquired data is written to the EP6's FIFO of 68013 which is work on slave FIFO mode. The FIFO is 512x4. My PC is programmed by VC++ 2008, using the function BeginDataXfer,WaitForXfer and FinishDataXfer to receive 2048Byte and then save them in a bin file per cycle.
But the received data is not continuous. Some data between every 2048Byte is lost. When I slow the DAC to 50SPS, the received data is OK.
How can I remove the data-losting under 5MB/s bulkin transfer?
The DAC is written the slaveFIFO continuously. I think if the bulkin transfer as quickly as necessary, the data-losting can be avoided. All maybe the bulk-transfer can not work for this situation,only Iso-transfer can? Thank you!
Some of my programme is below:
UINT ReadThreadLoop( LPVOID params ) { //线程处理
bool okin;
CUSBtest1Dlg *dlg = (CUSBtest1Dlg *) params;
OVERLAPPED inOvLap;
PUCHAR inData = new UCHAR[409600]; //数据缓冲区
ZeroMemory(inData,409600);
inOvLap.hEvent = CreateEvent(NULL, false, false, "CYUSB_IN");
dlg->InEndpt->TimeOut = 3;
for (;dlg->ReadThreadLooping 😉 //循环
{
LONG inlen=2048;
//异步读数据
UCHAR *inContext = dlg->InEndpt->BeginDataXfer(inData,inlen,&inOvLap);
dlg->InEndpt->WaitForXfer(&inOvLap,100);
okin = dlg->InEndpt->FinishDataXfer(inData,inlen, &inOvLap,inContext);
if (okin) //如果读取成功,则保存数据
{
mFile.SeekToEnd();
mFile.Write(inData,inlen);
}
else dlg->ReadThreadLooping = false;
}
CloseHandle(inOvLap.hEvent);
delete [] inData;
dlg->ReadThread = NULL; //线程结束
//dlg->USBDevice->Close(); //关闭USB设备
mFile.Flush(); //关闭文件
mFile.Close();
return true;
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Try 5MB/s bulkin transfer using streamer C:\Cypress\Cypress Suite USB 3.4.7\CyAPI\examples and see whether data lose is still happening or not.
Thanks
Prajith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi PRJR,
Thank you for you kind help!
But I still have a problem when use CyStreamer. When I download the cyStreamer firmware from C:\Cypress\Cypress Suite USB 3.4.7\Firmware\CyStreamer into my CY7C68013A, windows xp system can,t strart this device. The error code is "This device cannot start. (Code 10) " as shown in the attach pic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Please try the following
1.From device manager right click on your device and uninstall it.
2.Unplug and plug the device.
3.Now device will come up as USB device with a yellow mark on it.
4.From device manager right click on the device and select "Update driver"
5.Browse it to correct inf file which has your device's VID/PID in it.
Thanks
Prajith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
nice! This device cannot start(Code 10) is soved due to the wrong firmware supplied by C:\Cypress\Cypress Suite USB 3.4.7\Firmware\CyStreamer. The correct one can be got here: http://www.cypress.com/?app=forum&id=167&rID=48493 by Durko.
But the data losting in my data transferring is still not solved.
>>>
I found the solution (thx to Konst_777), there is error in source code of Streamer firmware. The correct version could be downloaded from https://rapidshare.com/files/457951304/CYStream_FW.7z
>>>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The cystreamer shows that the bulk in mode transfer can reach faster than 30MB/s. So my 5MB/s is viable.
I'll try synchronous slave FIFO mode (IFCONFIG=0x40).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content