USB HID with 2 data endpoints

General discussion on mikroBasic PRO for PIC32.
Post Reply
Author
Message
phil31
Posts: 348
Joined: 02 Apr 2009 15:02
Location: France
Contact:

USB HID with 2 data endpoints

#1 Post by phil31 » 26 Nov 2016 12:55

Dear All,

My application use USB HID device (libstock library).
The device is a slave and work when he receive some instructions from the HOST application (writing with Visual Studio)
All work as expected.

Now, my USB device may run an internal timer to send periodically (more or less quickly, depend of some HOST parameters) some data to the HOST application.
It work great, interrupts on HOST application fire right even with faster parameters.

My problem is that when my device send data periodically to the HOST, if I try to send new commands from the HOST to the device, sometime it hang the periodic data transmission !
I’m not sure if it’s a problem on the PIC USB side or on the HOST side. i’m just sure that I don’t turn off the PIC32 timer !


I would like to try something ( but I’m not convince about the result !)
Maybe I can define another endpoint dedicated to the stream pooling data from the device to the HOST.
Please anybody can point me or share a USB descriptor file which define 2 endpoints ?
And/or share his experience on something like this problem ?

thanks in advance, br
Phil

User avatar
uros.cvetinovic
mikroElektronika team
Posts: 803
Joined: 14 Dec 2015 09:24

Re: USB HID with 2 data endpoints

#2 Post by uros.cvetinovic » 28 Nov 2016 17:38

Hi Phil,

Please check "HIDDevice_Custom" example project.
It is located in the package where you installed libstock library:
...\Mikroelektronika\mikroBasic PRO for PIC32\Packages\USB_Device_PIC32\Examples\HIDDevice_Custom

There you will see descriptor file which has two endpoints, one for input packets, and other for output packets.

Best regards,

Uros

phil31
Posts: 348
Joined: 02 Apr 2009 15:02
Location: France
Contact:

Re: USB HID with 2 data endpoints

#3 Post by phil31 » 29 Nov 2016 10:19

Hello Uros,

well my message was maybe not fully clear ..
what i expect is at least 2 inputs and 1 output endpoints

thanks, regards

User avatar
uros.cvetinovic
mikroElektronika team
Posts: 803
Joined: 14 Dec 2015 09:24

Re: USB HID with 2 data endpoints

#4 Post by uros.cvetinovic » 30 Nov 2016 16:46

Hi Phil,

I understood you were asking for two endpoints.

Unfortunately, we have never used three endpoints in our examples.

I would have to check this with our software engineers and get back to you as soon as possible.

Best regards,

Uros

Post Reply

Return to “mikroBasic PRO for PIC32 General”