USB commands

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
ankurhanda

USB commands

Post by ankurhanda » Wed Oct 24, 2007 3:43 pm

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.

ankurhanda

USB buffer_length

Post by ankurhanda » Fri Oct 26, 2007 3:06 pm

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.

gert
Rank 1
Rank 1
Posts: 27
Joined: Sat Oct 20, 2007 5:58 pm

Post by gert » Fri Oct 26, 2007 4:26 pm

You can't expect any help, unless you give sufficient details about your application.
/G

Post Reply