You are here

maximum speed of USB in bulk-mode, USB interrupt | Cypress

maximum speed of USB in bulk-mode, USB interrupt

Summary: 4 Replies, Latest post by PSoC Rocks on 22 Dec 2012 04:23 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
homer123's picture
User
2 posts

Hi!

My question is concerning the maximum data-speed I can achieve with the USB-connection in bulk-mode.
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. I guess several packets can be sent and received at once. Am I right that the maximum speed I can achieve with this connection is 512byte/ms (500kb/s)?

A second question: 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?

Thanks in advance.

U2
uday's picture
Cypress Employee
569 posts

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.

 

homer123's picture
User
2 posts

Thanks a lot, now everything is clear to me.
I always thought that the Interval has no effect on bulk-transfer but I came across some different stories on the internet, which were all wrong, and I was a bit confused because PSoC Creator let me fill in a parameter to the interval-box when I have selected bulk-mode. Maybe that will be changed in future versions of the Creator.

Greetings from far away.

 

user_132296140's picture
User
5 posts

Are the ISRs called after completion for both IN and OUT endpoint bulk xfers?

PSoC Rocks's picture
User
141 posts

 Yes. ISR will be executed once the data transfer (In or Out) is complete.

Log in to post new comments.