Page 1 of 1

USB commands

Posted: Wed Oct 24, 2007 3:43 pm
by ankurhanda
Hi ,
i want to constanly get the feedback from AVR-USB based ATMega8 , i give a delay between two successive commands and sometime the host stops recognizing the USB device .

Code: Select all

command1 
system("usleep 8000");
command2


but if i don't give the delay , then the host stops detecting the device early. Actually i want to put a delay between two successive commands. putting a for loop puts the host in a same situation.

Any idea how to tackle that.
The interface works properly if i use serial port instead, but i want to use USB port.

USB buffer_length

Posted: Fri Oct 26, 2007 3:06 pm
by ankurhanda
Hi ,
I guess some buffer are overflowing if i am communicating like that , is there any way to check whether the buffer is full or not , or whether the buffer is empty or not , i checked the usb.h on my linux machine it has buffer_length ( urb->transfer_buffer_length = buffer_length ) as a variable which i guess is the length of the buffer for transfer , is there any way to check whether the buffer is empty or not ? i am using control messages to communicate with Atmega. please reply if anyone has an idea.

Posted: Fri Oct 26, 2007 4:26 pm
by gert
You can't expect any help, unless you give sufficient details about your application.
/G