usb goes for other usbs check

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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

0 Likes
15 Replies
Anonymous
Not applicable

 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

0 Likes
Anonymous
Not applicable

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

0 Likes
Anonymous
Not applicable

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

0 Likes
Anonymous
Not applicable

*recommended maximum

0 Likes
Anonymous
Not applicable

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.

0 Likes
Anonymous
Not applicable

can u see the excel file i sent.

0 Likes
Anonymous
Not applicable

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

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

check out the xls file

0 Likes
Anonymous
Not applicable

 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

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

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.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

xp file results

0 Likes
Anonymous
Not applicable

 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

0 Likes
Anonymous
Not applicable

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?

0 Likes
Anonymous
Not applicable

any one here answer me plz.

0 Likes
Anonymous
Not applicable

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

0 Likes