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
Code Block |
---|
|
endpointIdentifier.XferSize = DesiredValue; |
shall be used. Cypress sets DesiredValue to 4,096 bytes by default. This default value is not documented in the CyUSB.dll manual (pag 110-111 of CyUSB.NET.pdf), but it has been retrieved by using the following C# instructions:
Code Block |
---|
|
int XferSizeReadValue = outEndPointPipeNo.XferSize; |
...
Console.WriteLine("XferSize {0} ", XferSizeReadValue); |
Scroll Title |
---|
title | data throughput as a function of XferSize given PacketSize = 102,400 bytes |
---|
|
XferSize (bytes) | Throughput (Mbyte/s) | Data throughput [Mbyte/s] as a function of XferSize [byte] given PacketSize = 102,400 bytes. |
---|
PacketSize = 102,400 (bytes) | ![ThroughputVSXferSizeCpp.png](/plugins/servlet/confluence/placeholder/unknown-attachment?locale=en_GB&version=2)
| 4,096 (1) | 15.4 | 8,192 | 20.4 | 16,384 | 26.7 | 32,768 | 30.4 | 65,536 | 34.2 | 131,072 | 36.5 | 262,144 | 36.8 |
|
(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.
Scroll Title |
---|
title | data throughput as a function of PacketSize given XferSize = 102,400 bytes. |
---|
|
Packet Size (bytes) | Throughput (Mbyte/s) | Data throughput [Mbyte/s] as a function of PacketSize [byte] given XferSize = 102,400 bytes |
---|
XferSize = 131,072 (Bytes) | ![ThroughputVSPacketSizeCpp.png](/plugins/servlet/confluence/placeholder/unknown-attachment?locale=en_GB&version=2) | 512 | 2.32 | 1,024 | 4.25 | 2,048 | 7.65 | 4,096 | 15.22 | 8,192 | 20.35 | 16,384 | 25.45 | 32,768 | 31.05 | 65,536 | 35.34 | 131,072 | 37.01 |
|
Conclusion
If a higher throughput is desired,
...