Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > usb goes for other usbs check

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



usb goes for other usbs check
Moderator:
RSKV

Post Reply
Follow this topic



usb goes for other usbs check

talha posted on 18 Oct 2011 2:08 PM PST
Senior Member
11 Forum Posts

i am performing the data transfer of bulkendpoints continuously with out any delay. I am sending and receiving 8 bytes of data through the bulkend points.

after every 75 to 80  8 byte data transfer loop , I get the delay of 15 miliseconds. which is actually causing my data trasfer speed slow.  other wise all tests take .3 miliseconds or 0 seconds.

can  u tell me where is this 15 miliseconds coming from.

 

Thanks in advance

 




Re: usb goes for other usbs check

aasi posted on 19 Oct 2011 09:53 PM PST
Cypress Employee
1090 Forum Posts

 Are you using xferdata or begindataxfer/waitforxfer/finishdataxfer? In either case if the OS is busy you can expect intermittent delays. With xferdata you should always see this since you have wait for one to finish before you make the next call.

If you are using begindataxfer/..... etc you can expect delay between the end of one set of queueing and the beginning of the next set of queueing but this occurs very very rarely provided a large enough queueing has been implemented.

Regards,

Anand



Re: usb goes for other usbs check

talha posted on 20 Oct 2011 10:37 PM PST
Senior Member
11 Forum Posts

if this is because of xferdata or begin/wait/finish dataxfer functions, then each test or each sending or receiving data should have the delay of 15 miliseconds.

but 60 tests take no time but after every 60 tests there is a 15 milisecond delay.

please take a look at xls file you will have the idea.

please help me out.

thanks



Re: usb goes for other usbs check

aasi posted on 20 Oct 2011 10:55 PM PST
Cypress Employee
1090 Forum Posts

I think i know what the problem is.

The buffer we allocate in the host controller driver must be filling up after 60 transfers and the delay must be the delay taken by the OS to move the data from the host controller driver memory to the OS memory. Try using setxfersize to allocate more buffer. 64k is the recommended size for this buffer.

Regards,

Anand



Re: usb goes for other usbs check

aasi posted on 20 Oct 2011 10:55 PM PST
Cypress Employee
1090 Forum Posts

*recommended maximum



Re: usb goes for other usbs check

talha posted on 20 Oct 2011 12:11 AM PST
Senior Member
11 Forum Posts

no this is not like that.

I am using only 8 bytes of buffer of endpoints 1.

on each test, i transfer 8 bytes of data through out end point1 to the cypress controller. (begin data xfer only for out.)

and then next i send the command of in endpoint to get the 8 bytes of buffer result back. (begindataxfer and waitfor xfer only for in)

 

in thousands of test, each 60 th test take 15 milisecond.

is this because of computer goes polling other usb devices attached with systems.

plz help me.



Re: usb goes for other usbs check

talha posted on 20 Oct 2011 12:13 AM PST
Senior Member
11 Forum Posts

can u see the excel file i sent.



Re: usb goes for other usbs check

aasi posted on 20 Oct 2011 02:40 AM PST
Cypress Employee
1090 Forum Posts

I'm not able to see the excel sheet attachment in the thread.

Have you tried setting the buffer size on the PC side using SetXfersize? One other thing you can do, change your vid/pid to 04b4/1003 and use streamer/screamer of suiteusb to constantly receive data. Now look at whether you're seeing this delay.

Regards,

Anand



Re: usb goes for other usbs check

talha posted on 21 Oct 2011 03:10 AM PST
Senior Member
11 Forum Posts

check out the xls file



Re: usb goes for other usbs check

aasi posted on 21 Oct 2011 06:32 PM PST
Cypress Employee
1090 Forum Posts

 Please let me know the answer to the following questions

1. Are you using xferdata or begindataxfer/waitforxfer/finishdataxfer?

2. Is there anything different about the 60th transfer i.e. do you send a short packet or ZLP?

3. This seems to be timing calculated using the OS APIs. Have you looked at the USB bus traffic to see what is happening at the bus level?

Regards,

Anand



Re: usb goes for other usbs check

talha posted on 23 Oct 2011 03:24 AM PST
Senior Member
11 Forum Posts

I am using xferdata only for in and out transcation.
I am using 8 bytes buffer only for both bulk in and out endpoints buffer. but these buffers
are updated after every trascation. and these are used in a loop of 100 * 100 see this.

        byte[] data = new byte[8];

           int tests = 0;
            for (int i = 1; i <= 100; i++)
            {
                for (int j = i+1; j <= 100; j++)
                {
                    tests++;
                    AminTest(i, j);
                }
            }

     private bool AminTest(int p1, int p2)
        {
     -----------------------------
            data[1] = (byte)OMIfirstpincardno;
            data[2] = tempbyte1;


            data[3] = (byte)OMIsecondpincardno;
            data[4] = tempbyte1;

            data[5] = 0xFC;  //  1111 1100
            data[6] = 0x00;

           
            DateTime dt = DateTime.Now;
            outEndpoint.XferData(ref data, ref len);
            inEndpoint.XferData(ref data, ref len);

            //Console.WriteLine("{0},{1}: {2}", p1, p2, (DateTime.Now - dt).TotalMilliseconds);

            if (data[1] == 0)
                return true;
            else if (data[1] == 255)
                return false;
            return false;
        }

Now one more  thing I have experienced.
with pc core 2 duo with xp , I get 15 miliseconds delay after every 60th  test.

but with higher pc with win7 , I get 0 or 1 miliseconds delay on every  test.
file of usb result are attached.

take a look at it and help me.

how can i watch usb bus activity any good software. plz.



Re: usb goes for other usbs check

talha posted on 23 Oct 2011 03:25 AM PST
Senior Member
11 Forum Posts

xp file results

 



Re: usb goes for other usbs check

aasi posted on 23 Oct 2011 12:44 PM PST
Cypress Employee
1090 Forum Posts

 Xferdata is a synchronous call. So the next xferdata will be called only after the first xferdata complete. So with xferdata delays are expected.

I'm surprised that you're seeing a pattern in the delay. Please look at screamer/streamer to understand how to queue and use begindataxfer/waitforxfer/finishdataxfer. These delays should occur frequently or not at all using this approach.

Regards,

Anand



Re: usb goes for other usbs check

talha posted on 24 Oct 2011 09:42 PM PST
Senior Member
11 Forum Posts

please tell me which interface is good and most faster then other.

bulk transfer

isochronous transfer

control transfer

or

interrupt transfer

I have to send only 8 bytes of data on each transaction. but I need the speed of 20000 transaction per second.

Is it possible?



Re: usb goes for other usbs check

talha posted on 27 Oct 2011 02:54 AM PST
Senior Member
11 Forum Posts

any one here answer me plz.



Re: usb goes for other usbs check

Gayathri posted on 27 Oct 2011 06:09 AM PST
Cypress Employee
428 Forum Posts

Hello,

 

I think you should be able to meet transfer requirement with Bulk endpoint. Now for ISO transfers, buffer length and the endpoint's transfers size must be a multiple of 8 times the endpoint's MaxPktSize, when cyUSB.sys is used.So minimum length that need to be specified with the CyUSB.sys driver is 8 * times endpoint's maximum packet size. Since this is not the case in your application, BULK endpoint should be the choice.

Please note down the time in between the OUT transfer and the IN transfer. Let us try to narrow down where exactly the delay is being caused?

USB Analyzers like CATC/ Ellysis would be a good choice since that would shed some light as to what is happening at the USB packets level. Is there any way, you can get USB trace? 

 

Regards,

Gayathri






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20