|
My question is concerning the maximum data-speed I can achieve with the USB-connection in bulk-mode.
We have seen speeds as high as 1Mbits/Sec on Bulk Endpoint with CyUSB.dll.
In the endpoint attributes I can set the mximum packet size to 64 byte and the intervval to 1 ms, while the data sheet says that the methods USBFS_ReadOutEP and USBFS_LoadInEP say that they can handle a length of 512 byte.
The API is a generic API for all types of USB data transfer, that is, Interrupt, Bulk and ISOC. The methods USBFS_ReadOutEP and USBFS_LoadInEP can handle 512 bytes for ISOC transfer. For Bulk transfer, the above APIs can handle only upto 64 bytes. All this is according to USB spec, " For full speed endpoints, the maximum bulk packet size is either 8, 16, 32 or 64 bytes long." In the API USBFS_LoadInEP, a check is made for the Maximum packet size parameter that is specified in the USBFS customiser and Limits length to available buffer space(64 in case of Bulk transfer). The interval parameter is valid only for Interrupt type of transfer(Host polls USB device at regular interval), for bulk transfer this parameter is irrelavant. Bulk transfer is considered to be an asynchronous type of transfer.
the data-sheet of the device says that all USB-transfers trigger an interrupt. How can I check if an interrupt of a bulk-out-transfer occured?
Every Endpoint in PSoC3/PSoC5 is associated with an Endpoint interrupt and an ISR. These ISRs can be seen in the file, USBFS_1_episr.c. For example USBFS EP ISR is seen as,
CY_ISR(USBFS_1_EP_1_ISR)
{
/* `#START EP1_USER_CODE` Place your code here */
/* `#END` */
CY_GET_REG8(USBFS_1_SIE_EP1_CR0_PTR); /* Must read the mode reg */
......................
......................
}
Similarly other ISRs are avilable in the same file. If you have configured a particular Endpoint as Bulk In Endpoint, the corresponding ISR will be triggerd when host sends a packet and you can set a falg within this ISR to indicate the occurrence of this ISR.
I hope this helps.
|