HID & Force Feedback

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: HID & Force Feedback

Post by ulao » Thu May 27, 2010 11:02 pm

Ok learned bit here..


On start up we get c,4 stop all effects.

Once I run an effect I see that come in. For example I create a constant force and I see 1,1 see report below..

Code: Select all

 0x09,0xAB,    //    Usage Undefined
   0xA1,0x02,    //    Collection Datalink
      0x85,0x01,    //    Report ID 1
      0x09,0x25,    //    Usage Effect Type
      0xA1,0x02,    //    Collection Datalink
      0x09,0x26,    //    Usage ET Constant Force
      0x09,0x27,    //    Usage ET Ramp
      0x09,0x30,    //    Usage ET Square
      0x09,0x31,    //    Usage ET Sine
      0x09,0x32,    //    Usage ET Triangle
      0x09,0x33,    //    Usage ET Sawtooth Up
      0x09,0x34,    //    Usage ET Sawtooth Down
      0x09,0x40,    //    Usage ET Spring
      0x09,0x41,    //    Usage ET Damper
      0x09,0x42,    //    Usage ET Inertia
      0x09,0x43,    //    Usage ET Friction
      0x09,0x28,    //    Usage ET Custom Force Data
      0x25,0x0C,    //    Logical Maximum Ch (12d)
      0x15,0x01,    //    Logical Minimum 1
      0x35,0x01,    //    Physical Minimum 1
      0x45,0x0C,    //    Physical Maximum Ch (12d)
      0x75,0x08,    //    Report Size 8
      0x95,0x01,    //    Report Count 1
      0xB1,0x00,    //    Feature
   0xC0     ,    // End Collection



FYI here is report C, as you can see 1 is stop all effects.

Code: Select all

   0x09,0x96,    //    Usage DC Disable Actuators
   0xA1,0x02,    //    Collection Datalink
      0x85,0x0C,    //    Report ID Ch (12d)
      0x09,0x97,    //    Usage DC Stop All Effects
      0x09,0x98,    //    Usage DC Device Reset
      0x09,0x99,    //    Usage DC Device Pause
      0x09,0x9A,    //    Usage DC Device Continue
      0x09,0x9B,    //    Usage PID Device State
      0x09,0x9C,    //    Usage DS Actuators Enabled
      0x15,0x01,    //    Logical Minimum 1
      0x25,0x06,    //    Logical Maximum 6
      0x75,0x08,    //    Report Size 8
      0x95,0x01,    //    Report Count 1
      0x91,0x00,    //    Output
   0xC0     ,    //    End Collection



For reference here is the info on the report communication. ( around page 35 )
http://www.usb.org/developers/devclass_docs/pid1_01.pdf

see page 42

once the device receives this Set Report request and validates that it is capable of performing the
requested operation, the device allocates the memory for the requested effect. The size of the
allocated memory is decided by device


If I send this 02 01 02 FF FF, I get the output device is full and I should
If I send this 02 01 03 FF FF, I get the output error and I should
If I send this 02 01 01 FF FF, Fedit freezes..?

My guess is the memory ff,ff. I have no idea what I should put in there..

FYI:
02 is the report
01 is the effect index you get from the set 1,1 I talked about above.
01/02/03/ is the response error or success code.
the next two are allocated memory and I think its where I'm failing.

Quick update the reason for the freeze was my endpoint 3 was 64, I made it an 8, SHE IS ALIVE!!! I friggen did it, rumble works ;) tested and working in project 64 as well ;)


:: As it seems the person of interested has dropped off the topic here, so I'm done reporting status unless otherwise asked.

Easty

Re: HID & Force Feedback

Post by Easty » Wed Jun 09, 2010 7:31 pm

Sorry, was abroad for some days and hadn't access to any internet :) Are you willing to post a full excerpt of everything belonging to the FB part? (descriptor & receive/send/setup functions)

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

Re: HID & Force Feedback

Post by ulao » Thu Jun 10, 2010 3:06 pm

Not at the moment (inthe middle of making a write up) , but would be more than willing to help you. Give me a shout on that other board as there is no PM here.

FFB.BOY.30
Posts: 1
Joined: Tue Dec 11, 2012 8:53 am

Re: HID & Force Feedback

Post by FFB.BOY.30 » Tue Dec 11, 2012 9:01 am

Hi,
Is someone can share the final descriptor or at least tell me if someone is interesting to reactive this project ?

Thanks

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

Re: HID & Force Feedback

Post by ulao » Tue Dec 11, 2012 7:45 pm

for an example of the descriptor see Post #: 35 at this link http://www.microchip.com/forums/tm.aspx ... 25&mpage=2

Yes its big, yes I tried to chop it down, no it does no budge. You will need the latest version of v-usb as a patch had to be made to allow > 254 descriptor lengths.

Post Reply