Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Problem about CY7C68013A transfer 5MB/s data from a 5MHz DAC to PC

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Problem about CY7C68013A transfer 5MB/s data from a 5MHz DAC to PC
Moderator:
RSKV

Post Reply
Follow this topic



Problem about CY7C68013A transfer 5MB/s data from a 5MHz DAC to PC

petrol posted on 30 May 2012 2:19 AM PST
Member
5 Forum Posts

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;
}
 




Re: Problem about CY7C68013A transfer 5MB/s data from a 5MHz DAC to PC

PRJI posted on 03 Jun 2012 02:46 AM PST
Cypress Employee
333 Forum Posts

 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



Re: Problem about CY7C68013A transfer 5MB/s data from a 5MHz DAC to PC

petrol posted on 10 Jun 2012 08:05 PM PST
Member
5 Forum Posts

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.



Re: Problem about CY7C68013A transfer 5MB/s data from a 5MHz DAC to PC

PRJI posted on 11 Jun 2012 10:10 PM PST
Cypress Employee
333 Forum Posts

 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

 



Re: Problem about CY7C68013A transfer 5MB/s data from a 5MHz DAC to PC

PRJI posted on 11 Jun 2012 10:19 PM PST
Cypress Employee
333 Forum Posts

 Hi,

 Please see http://www.cypress.com/?app=forum&id=167&rID=48493 also.

 



Re: Problem about CY7C68013A transfer 5MB/s data from a 5MHz DAC to PC

petrol posted on 11 Jun 2012 12:52 AM PST
Member
5 Forum Posts

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 
>>>



Re: Problem about CY7C68013A transfer 5MB/s data from a 5MHz DAC to PC

petrol posted on 11 Jun 2012 02:28 AM PST
Member
5 Forum Posts

  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).



Re: Problem about CY7C68013A transfer 5MB/s data from a 5MHz DAC to PC

PRJI posted on 12 Jun 2012 11:22 PM PST
Cypress Employee
333 Forum Posts

 Hi,


  See http://www.cypress.com/?docID=29941, it would be helpful for you.


Thanks


Prajith






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20