Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > To use EP6IN as 1024 size better than 512.

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



To use EP6IN as 1024 size better than 512.
Moderator:
RSKV

Post Reply
Follow this topic



To use EP6IN as 1024 size better than 512.

acorrd posted on 27 Aug 2011 2:57 AM PST
Senior Member
12 Forum Posts

Hello,

On CY7C68013, I want to use 1024 size enpoint in packet better than 512 size for EP6.
It should be get more transfer speed.

I've modified below three parts only. But it operates incorrect.
Are there more parts to run as 1024 ?


1.  in FX2_to_extsyncFIFO.c file.

void TD_Init(void)       
{
  // set the CPU clock to 48MHz
  CPUCS = ((CPUCS & ~bmCLKSPD) | bmCLKSPD1);
  SYNCDELAY;

  EP2CFG = 0xA0;     // EP2OUT, bulk, size 512, 4x buffered
  SYNCDELAY;      
#if 0
  EP6CFG = 0xE0;     // EP6IN, bulk, size 512, 4x buffered    
  SYNCDELAY;

#else//test 1024 size packet
 EP6CFG = 0xE8;     // EP6IN, bulk, size 1024, 4x buffered    
 SYNCDELAY;
#endif


............

}

2. in Dscr.a51 file
;; Endpoint Descriptor
      db   DSCR_ENDPNT_LEN      ;; Descriptor length
      db   DSCR_ENDPNT          ;; Descriptor type
      db   86H                  ;; Endpoint number, and direction
      db   ET_BULK              ;; Endpoint type
   ;;   db   00H                  ;; Maximum packet size (LSB)
    ;;  db   02H                  ;; Maximum packet size (MSB)
      db   00H                  ;; Maximum packet size (LSB)
   db   04H                  ;; Maximum packet size (MSB) for 1024 size.

      db   00H                  ;; Polling interval

 

3.  in FX2_to_extsyncFIFO.c file.

BOOL DR_SetConfiguration(void)  
{
  if( EZUSB_HIGHSPEED( ) )
  { // FX2 enumerated at high speed


#if 0  //test 1024 size
 SYNCDELAY;                  //
    EP6AUTOINLENH = 0x02;       // set AUTOIN commit packet length to 512 bytes. high byte
    SYNCDELAY;                  //
    EP6AUTOINLENL = 0x00;  //low byte. thus, 0x200 = 512.
    SYNCDELAY;        
#else
 SYNCDELAY;                  //
    EP6AUTOINLENH = 0x04;       // set AUTOIN commit packet length to 1024 bytes. high byte
    SYNCDELAY;                  //
    EP6AUTOINLENL = 0x00;  //low byte. thus, 0x200 = 512.
    SYNCDELAY; 

#endif

 

...........

}

 




Re: To use EP6IN as 1024 size better than 512.

acorrd posted on 27 Aug 2011 03:20 AM PST
Senior Member
12 Forum Posts

in datasheet, EP6 must be 2048 bytes maximum.

If I want to use 1024 packet for EP6IN, I must use double buffering, not quad buffering.

because , there are only 2048 bytes for EP6.

Below is added code to above posting.

#if 0
  EP6CFG = 0xE0;     // EP6IN, bulk, size 512, 4x buffered    
  SYNCDELAY;
  #else//test 1024 size buffer
EP6CFG = 0xEA;     // EP6IN, bulk, size 1024, 2x buffered    
  SYNCDELAY;
  #endif

after test above, our board has 20MB/sec speed. previous speed is 16MBs.^^.

But someone on google presents their system has 30~40MBs with normal PC environment.

How can I get more speed  like anyone ?

 

 

 



Re: To use EP6IN as 1024 size better than 512.

Chris R. posted on 27 Aug 2011 01:05 PM PST
Top Contributor
135 Forum Posts

We reach 40MB/s with 25MHz IFCLK on sync Slave FIFO 16 bit bus width. We use 512 Byte endpoint with quad buffering. 1024 byte causes some problems on some host controllers. For high data rate you have to transfer large blocks in order to give the FX2 the opportunity to fille the microframes with packets. If you transfer every single 512 byte packet you can only get 4MB/s, with 1024 Byte transfers 8MB/s and so on. There are 8000 Microframes per second and one microframe can hold 10...11 full 512 byte packets. But only if all packets are in one request. The maximum we´ve seen is 40.5MB/s upload while several hundret kB/s download using winusb on Windows 7 x64.



Re: To use EP6IN as 1024 size better than 512.

acorrd posted on 27 Aug 2011 09:36 PM PST
Senior Member
12 Forum Posts

Dear Chris.R,

Thanks your advise



Re: To use EP6IN as 1024 size better than 512.

acorrd posted on 27 Aug 2011 09:53 PM PST
Senior Member
12 Forum Posts

Dear Chris.R,

Thanks your advise.

But in my experience, My board can't go beyond 20MBs.

Samsung SensR610 Notebook, KojnSha notebook, Dell Core i3 Desktop, entire.

 

Current testing environment,

- 1Mbyte upload each try. 1MB uploaded -> 2 sec rest -> 1MB uploaded -> 2sec rest....repeat.

- used GPIF flow state likely cypress example on AN66806.pdf.

- GPIF counter has set 0x00, 0x08, 00,00 as 500kB counting for 1MB data in 16 bit data bus.

-  Host uses BeginDataXfer(), waitXfer(), FinishDataXfer() presented in example.

- by Logic analyzer, timing chart is

    total 50 msec is required to upload 1MB.

    MCU firstly prefetches 1024 counting as it's buffer size 2048. ->

    some milisecond of rest ->

   transfer about 200 usec ->

   wait 200 usec.->

  repeatdely run to complete 1MB.

- RDY pin tied to VCC for highest speed testing.

 

 - uploaded data was verified by HHD software's USB monitor program.

  

I should more try to get about 40MBs.

But this is fixed for futher developement with your advice. Thanks !!!

 - 512 fifo size, quad buffering.

I will try other parts to advance speed.



Re: To use EP6IN as 1024 size better than 512.

aasi posted on 29 Aug 2011 10:03 PM PST
Cypress Employee
1090 Forum Posts

Hi,

What is the IFCLK frequency?

Please use Screamer/Streamer from SuiteUSB to do throughput measurement and let us know the throughput value achieved so that we have a common frame of reference to discuss further.

Regards,

Anand






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: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20