transfering more interrupt in data

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Madara
Posts: 7
Joined: Fri Jun 29, 2012 1:35 pm

transfering more interrupt in data

Post by Madara » Mon Sep 30, 2013 10:10 am

I need to transfer 64 bytes of Interrupt In transfer to PC via AVR. The function usbSetInterrupt is able to transfer only 8 bytes at a time.Using it 8 times to transfer 64 bytes does not seem to be a solution. There is a line in usbdrv.h "If you need to transfer more bytes, use a control read after the interrupt." in the description of usbSetInterrupt.

What is control read and how to transfer more interrupt in data using this method??

matrixstorm
Posts: 16
Joined: Tue Sep 18, 2012 2:30 pm

Re: transfering more interrupt in data

Post by matrixstorm » Mon Sep 30, 2013 12:48 pm

Hi Madara.

VUSB only implements low-speed USB. In low-speed USB the standard forces:

[...]
The maximum data payload size for low-speed devices is 8 bytes.
[...] (from: http://www.beyondlogic.org/usbnutshell/ ... #Interrupt)

So, you can not implent sth. the standard does not allow.

BR matrixstorm

Madara
Posts: 7
Joined: Fri Jun 29, 2012 1:35 pm

Re: transfering more interrupt in data

Post by Madara » Tue Oct 01, 2013 7:05 am

The maximum data payload size is 8 bytes for Control transfers as well.However we are able to transfer upto 254 bytes in VUSB by transferring them in a chuncks of 8 bytes in single control requests. I was wondering if this could be done for interrupt tranfers as there is a little description as "If you need to transfer more bytes, use a control read after the interrupt." in the description of usbSetInterrupt.

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

Re: transfering more interrupt in data

Post by ulao » Tue Oct 01, 2013 1:45 pm

You can not transfer that much data in one go but of course you can do it by chunks in interrupt transfers.


while (!usbInterruptIsReady()){usbPoll(); } usbSetInterrupt( reportBuffer, 8 );
while (!usbInterruptIsReady()){usbPoll(); } usbSetInterrupt((void *)&reportBuffer + 8, 8 );
while (!usbInterruptIsReady()){usbPoll(); } usbSetInterrupt((void *)&reportBuffer + 16, 8 );
ect...

Post Reply