Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

XferSize is the dimension (in bytes) of the buffer reserved (on the host computer) for the data transfer over the USB channel between one USB FX2 endpoint and the host computer.

PacketSize is the dimension (in bytes) of the data array to be transferred over the USB channel between one USB FX2 endpoint and the host computer. This data array is subdivided into packets of dimension ≤ MaxPktSize = 512 and scheduled for transmission over the USB channel.

XferSize (driver buffer size)

...

Influence

Given a PacketSize of 102,400 bytes (it can be subdivided into 200 USB packets of 512 bytes), the influence of XferSize (driver buffer size reserved for data communication) on the throughput is reported in the following table. 

To change XferSize in C++, the method
BulkEndPoint->SetXferSize(DesiredValue);
shall be used. Cypress sets DesiredValue to 4,096 bytes by default. This default value is not documented in the CyAPI.lib manual (pag 62 of CyAPI.pdf), but it has been retrieved by using the following C++ instructions:
int XferSizeReadValue = BulkEndPoint->GetXferSize();
co

 

 

ut<< cout<< "XferSizeReadValue" << XferSizeReadValue <<endl;

...

(1) Cypress XferSize Default = 4096 

PacketSize (transfer data size) Influence

Given an XferSize (driver buffer size) of 131,072 bytes, the influence of PacketSize on the throughput is reported in the following table.

...

To transfer the array of data with dimension PacketSize in C++, the method XferData() shall be used.

Conclusion

If a higher throughput is desired,

...

Recommended values are :

  • XferSize = 131,072 bytes and PacketSize = 131,072 bytes

for a throughput of ≈ 37 Mbyte/s.

  • XferSize = 65,536 (or 102400) bytes and PacketSize = 65,536 536 (or 102400) bytes

for a throughput of ≈ 35 Mbyte/s.