cancel
Showing results for 
Search instead for 
Did you mean: 

USB Low-Full-High Speed Peripherals

Anonymous
Not applicable

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

   

 

   

...........

   

}

0 Likes
1 Solution
Anonymous
Not applicable

Dear Chris.R,

   

Thanks your advise

View solution in original post

0 Likes
5 Replies
Anonymous
Not applicable

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 ?

0 Likes
Anonymous
Not applicable

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.

0 Likes
Anonymous
Not applicable

Dear Chris.R,

   

Thanks your advise

View solution in original post

0 Likes
Anonymous
Not applicable

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.

0 Likes
Anonymous
Not applicable

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

0 Likes