sending at least 50 bytes from PC to AVR

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Kernel
Posts: 1
Joined: Thu Dec 27, 2007 5:50 pm

sending at least 50 bytes from PC to AVR

Post by Kernel » Thu Dec 27, 2007 6:04 pm

Hi.
I already have established a connection between PC and the AVR and can exchange commands and data between both of them.
Now I want to send at least 50 bytes from PC to the AVR to store these and later print them on an external display.
My question now is, how I can arrange this.
Can please somebody tell/show me, what I have to do, to send the data over the USB to the AVR?

Thanks a lot.

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Thu Dec 27, 2007 8:41 pm

You need to implement usbFunctionWrite() and return -1 in usbFunctionSetup() for a particular request. When you send this request from the host, the driver will call usbFunctionWrite() in chunks of 8 bytes until all data is received.

See usbdrv.h for a description of usbFunctionWrite() and usbFunctionSetup(). You need to enable usbFunctionWrite() in usbconfig.h.

An example for this can be found in Automator, although this is also a HID compliant device. On the other hand, you might want to be HID compliant, too.

Post Reply