Transfer idea needed

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
bla
Posts: 9
Joined: Tue Jul 26, 2011 10:25 pm

Transfer idea needed

Post by bla » Tue Jul 26, 2011 10:35 pm

Hi,

I'm quite unexperienced with USB/HID in general so I need some help.

Using HID is mandatory. On my µC I have a table full of data. It's pretty much as big as the eeprom is. The host software (written in Delphi using a TJvHidDeviceController component) needs to be able to update each line in this table. I already figured this out (SetFeature). Using GetFeature to read a predefined line also works.
The "problem" now is to read out any other line of the table. Or all of them. Let's say I want to read line 23. My idea was to introduce a new report id just to tell the µC which line is next with SetFeature, then use GetFeature. A bit complicated, isn't it? How would you do it?

Thanks.

_frank26080115

Re: Transfer idea needed

Post by _frank26080115 » Thu Jul 28, 2011 5:46 am

Your report should consist of an address followed by data, all contained into one report

bla
Posts: 9
Joined: Tue Jul 26, 2011 10:25 pm

Re: Transfer idea needed

Post by bla » Thu Jul 28, 2011 11:14 am

But if I use GetFeature, no data (besides the report id) gets transferred to the µC, right?

Daid
Rank 2
Rank 2
Posts: 55
Joined: Mon Apr 18, 2011 12:19 pm

Re: Transfer idea needed

Post by Daid » Thu Jul 28, 2011 12:32 pm

Each request you do to the USB device has a "value" parameter, which can be filled with anything you want. You could use it as an address so you can do multiple requests. (the usbRequest_t recieves this value in wValue)

bla
Posts: 9
Joined: Tue Jul 26, 2011 10:25 pm

Re: Transfer idea needed

Post by bla » Thu Jul 28, 2011 12:42 pm

This sounds great. :) Now I only have to find out how to use it with TJvHidDeviceController..... hmmm...

Micha

Re: Transfer idea needed

Post by Micha » Fri Jul 29, 2011 8:28 am

Perhaps you can take http://www.mikrocontroller.net/articles ... r#Download as an example. The dll is written in Delphi and maybe the author will share some code with you if you ask him. His name is Hugo Portisch.

Post Reply