1 2 Previous Next 14 Replies Latest reply on Oct 27, 2011 8:09 AM by GayathriV_16

    usb goes for other usbs check

      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

        • 1. Re: usb goes for other usbs check

           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.





          • 2. Re: usb goes for other usbs check

            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.



            • 3. Re: usb goes for other usbs check

              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.





              • 4. Re: usb goes for other usbs check

                *recommended maximum

                • 5. Re: usb goes for other usbs check

                  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.

                  • 6. Re: usb goes for other usbs check

                    can u see the excel file i sent.

                    • 7. Re: usb goes for other usbs check

                      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.





                      • 8. Re: usb goes for other usbs check

                        check out the xls file

                        • 9. Re: usb goes for other usbs check

                           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?





                          • 10. Re: usb goes for other usbs check

                            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++)
                                                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.

                            • 12. Re: usb goes for other usbs check

                               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.





                              • 13. Re: usb goes for other usbs check

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


                                bulk transfer


                                isochronous transfer


                                control transfer




                                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?

                                • 14. Re: usb goes for other usbs check

                                  any one here answer me plz.

                                  1 2 Previous Next