usbSetInterrupt vs HID Report Descriptor

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

usbSetInterrupt vs HID Report Descriptor

Post by mirekk36 » Wed Oct 27, 2010 11:37 pm

Hi all,

can anybody help me? I have in my code this HID descriptor:

Code: Select all

PROGMEM char usbHidReportDescriptor[22] = {    /* USB report descriptor */
    0x06, 0x00, 0xff,              // USAGE_PAGE (Generic Desktop)
    0x09, 0x01,                    // USAGE (Vendor Usage 1)
    0xa1, 0x01,                    // COLLECTION (Application)
    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
    0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)
    0x75, 0x08,                    //   REPORT_SIZE (8)
    0x95, 0x10,                    //   REPORT_COUNT (16)   // tu można dać 0x40 np 64 bajtową ramkę tylko trzeba zwięszyć bufor danych do 64
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0xc0                           // END_COLLECTION
};


I can send and receive any data to and from PC without any problems using functions:

usbFunctionRead()
usbFunctionWrite()

but i have a BIG problem to send some data with:

usbSetInterrupt()

it's don't work anyway.

I feel that this is related to the HID descriptor, but I do not know how to solve the problem. I need to spontaneously send some data to a PC.

_frank26080115

Re: usbSetInterrupt vs HID Report Descriptor

Post by _frank26080115 » Thu Oct 28, 2010 6:45 pm

did you enable the interrupt-in endpoint in usbconfig?

are you looping usbPoll after calling usbSetInterrupt?

is the interrupt-in endpoint ready before usbSetInterrupt is called?

mirekk36

Re: usbSetInterrupt vs HID Report Descriptor

Post by mirekk36 » Fri Oct 29, 2010 9:10 pm

_frank26080115 wrote:did you enable the interrupt-in endpoint in usbconfig?

Yes ofcourse

_frank26080115 wrote:are you looping usbPoll after calling usbSetInterrupt?


I'm using JvHid component under Dlphi. This componnent pools in a thread , I can see it when I connect someone GamePad and press any key on it. This keycodes appears in this sample program.

_frank26080115 wrote:is the interrupt-in endpoint ready before usbSetInterrupt is called?

Yes I check this.

I only can send and receive some data with set or get feature report on PC to or from my AVR device.

_frank26080115

Re: usbSetInterrupt vs HID Report Descriptor

Post by _frank26080115 » Sat Oct 30, 2010 8:05 am

I think "FEATURE" is host-to-device

dzairo
Rank 1
Rank 1
Posts: 35
Joined: Wed Sep 22, 2010 3:31 pm

Re: usbSetInterrupt vs HID Report Descriptor

Post by dzairo » Sat Oct 30, 2010 10:05 am

Hi mirek36.
I too want communicate with Delphi <-> HID avr.
Have any news???

Guest

Re: usbSetInterrupt vs HID Report Descriptor

Post by Guest » Sun Oct 31, 2010 12:38 am

_frank26080115 wrote:I think "FEATURE" is host-to-device


Yes, U have right, and therefore I'm looking for opportunities to spontaneously send data from device-to-host

Do You have maybe some simple sample or some link to do that ? pls


dzairo wrote:Hi mirek36.
I too want communicate with Delphi <-> HID avr.
Have any news???


Form Delphi code it's quiet simple, you have sample code for Delphi "SimpleHIDWrite.dpr", try it and look how do that from own code.

_frank26080115

Re: usbSetInterrupt vs HID Report Descriptor

Post by _frank26080115 » Mon Nov 01, 2010 7:07 am

I believe "INPUT" is device-to-host

dzairo
Rank 1
Rank 1
Posts: 35
Joined: Wed Sep 22, 2010 3:31 pm

Re: usbSetInterrupt vs HID Report Descriptor

Post by dzairo » Tue Nov 02, 2010 11:37 am

Hi
Using JvHID ... with HID is not very easy.
If try exist code (delphi demo) then show any error and no other.
But some user help me to create delphi code using libusb.pas but need install driver in to OS.
If any one know how to create function demo for delphi pls , create and post it .
I still don't know how make it on Delphi with JvHID....

regards

handco

Re: usbSetInterrupt vs HID Report Descriptor

Post by handco » Thu Sep 15, 2011 5:12 pm

mirekk36 wrote:Hi all,

can anybody help me? I have in my code this HID descriptor:

Code: Select all

PROGMEM char usbHidReportDescriptor[22] = {    /* USB report descriptor */
    0x06, 0x00, 0xff,              // USAGE_PAGE (Generic Desktop)
    0x09, 0x01,                    // USAGE (Vendor Usage 1)
    0xa1, 0x01,                    // COLLECTION (Application)
    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
    0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)
    0x75, 0x08,                    //   REPORT_SIZE (8)
    0x95, 0x10,                    //   REPORT_COUNT (16)   // tu można dać 0x40 np 64 bajtową ramkę tylko trzeba zwięszyć bufor danych do 64
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0xc0                           // END_COLLECTION
};


I can send and receive any data to and from PC without any problems using functions:

usbFunctionRead()
usbFunctionWrite()

but i have a BIG problem to send some data with:

usbSetInterrupt()

it's don't work anyway.

I feel that this is related to the HID descriptor, but I do not know how to solve the problem. I need to spontaneously send some data to a PC.


Dear Mirekk36,
which software are you using for exchanging data from/to pc ? I'm using SimpleHIDWrite from the delphi hid example and nothing appears.
Can I have your main.c for AVR ?

regards,
hc

Post Reply