LPC2368 HID issues with implementing interrupt IN and OUT pipe together

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC2368 HID issues with implementing interrupt IN and OUT pipe together

280 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by manoS on Mon Sep 08 23:43:20 MST 2014
Hello,

I am new to USB HID protocol.

I am using LPC2368 to implement HID protocol.

My requirement is to send data to host at given time interval and to accept some response from host/PC which is independent of the data being sent by device to host.
For this have done implementation using interrupt pipes:
IN Pipe (End Point number 1) ---> To send data to Host/PC.
OUT Pipe (End Point number 4) ---> To receive data from Host/PC.

When I test these pipes individually, they work absolutely OK.

But when implemented together following problems /observations are seen:
1. IN Pipe works fine initially. But wen something is sent on OUT pipe(by Host) it is received via Control Pipe (Pipe 0).
2.At this instance IN Pipe stops working.


Can someone please let me know :
1. Is there something wrong with implementation logic?
2. Cant we have IN interrupt Pipe and OUT interrupt Pipe initialized in one application?

Looking forward for reply.


Labels (1)
0 Kudos
1 Reply

233 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mch0 on Wed Sep 10 08:55:15 MST 2014
Hi Sonam,

the HID class allows both IN and OUT pipes for an interface simultaneously. I have used that often.
Right now I have that configuration active in a LPC4370 project (using the ROM API).

Make sure you have:

a) both interrupt endpoints defined in the configuration descriptor
b) both IN and OUT reports defined in the HID specific report descriptor
c) used the correct call on the host side to write data. With windows sth. like "WriteFile()", not "HidD_SetOutputReport()"

The latter sends the OUT-Report to EP0, the former to the interrupt EP you have defined. Since you get data on the control pipe, windows has decided not to use the OUT EP, either because none was defined or because of the wrong call.

There is a freeware program called USBVIEW which shows you a lot of useful information about the enumerated USB devices. I'd recommend to run it and first check, whether your device shows the HID interface with both EP as you expect them.

One last pit I managed to fall in once: Don't send more data in a report than you have advertised in the report descriptor.

Regards,

Mike

0 Kudos