poll timing

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
ulao
Rank 4
Rank 4
Posts: 479
Joined: Mon Aug 25, 2008 8:45 pm

poll timing

Post by ulao » Sun Jun 16, 2013 1:10 am

Trying to tweak poll timing a bit here. I'm set to 10ms in config

So I normally do this
while (!usbInterruptIsReady()){usbPoll(); } usbSetInterrupt((void *)&reportBuffer + 0, 8);
while (!usbInterruptIsReady()){usbPoll(); } usbSetInterrupt((void *)&reportBuffer + 8, 5);

If I do it one like
while (!usbInterruptIsReady()) { usbPoll();}
usbSetInterrupt((void *)&reportBuffer + 0, 8 );//send the data

I get 8 ms, doing it like above I get 16ms. Ok makes sense twice right. I need to run two sets as I have 13 packets to send. So is there a better way? I tried this but it does not send all 13.
while (!usbInterruptIsReady()) { usbPoll();}
usbSetInterrupt((void *)&reportBuffer + 0, 8 );//send the data
usbSetInterrupt((void *)&reportBuffer + 0, 5 );//send the data

ulao
Rank 4
Rank 4
Posts: 479
Joined: Mon Aug 25, 2008 8:45 pm

Re: poll timing

Post by ulao » Mon Jun 24, 2013 7:07 pm

Ok just saw something in my code I didnt see the first go. I'm set to 10 in config but I my descriptor I have this

USBDESCR_ENDPOINT, /* descriptor type = endpoint */
//0x81, /* IN endpoint number 1 */
0x81, // bulk IN endpoint number 1
0x03, /* attrib: Interrupt endpoint */
8, 0, /* maximum packet size */
0x04, /* in ms */

So I did some testing. Seem changing does the following.

0:ms = 64 ms
1-16 ms = 16 ms
> 16 ms = that which is entered.

Not sure on the 0 thing? Though it seems I get 16ms no matter what I set unless I set greater than that. So I take that as, Windows will take 8 ms per packet send. Since I can only send 8 ( actually its 10 ) at a time I must send two times. There is no way to do it faster? Guessing using another end point would give he same results?

Post Reply