PR26 (Build Failed)

LED Blinking, Walking with Cytron Servo, Displaying RFID, Multi-function Mobile Robot......

Re: PR26 (Build Failed)

Postby Innovative » Sun Aug 14, 2011 12:51 pm

Yeah! Got it and USB keyboard functioning well now... thank you!! thank you!!
BTW, I have another idea to do a combo with USB Keyboard + mouse click + output for LED, do you have any idea we can combine the different device in the USB_descriptor and how to use it?

Thanks!
Innovative
Newbie
 
Posts: 10
Joined: Thu Jan 27, 2011 1:11 pm

Re: PR26 (Build Failed)

Postby A380 » Sun Aug 14, 2011 2:03 pm

Can. But you need to modify the HID Descriptor part in usb_descriptors.c and usb_config.h. I haven't try it yet but I found a site about the multiple HID devices in one, http://frank.circleofcurrent.com/cache/ ... rial_1.htm To create your own HID Descriptor, you can use this tool, http://www.usb.org/developers/hidpage#HID Descriptor Tool, click "HID Descriptor Tool" to download.
User avatar
A380
Discoverer
 
Posts: 120
Joined: Tue May 19, 2009 2:44 pm
Location: Malaysia

Re: PR26 (Build Failed)

Postby Innovative » Wed Sep 07, 2011 1:50 pm

I got the mouse + Keyboard by using PIC18F2550 it working well. However, i would like to change it become HID output Keyboard. I have change the descriptor to HID output + Keyboard as below but when i plug in it shown yellow bang in the device list.
BtW, do you know how to configure the VID and PID? for the working mouse + keyboard if i change the VID / PID then the device will not be working anymore.
Please let me how is the code if you already success to build the HID output + Keyboard, feel that it is usefull.
rom struct{byte report[HID_RPT01_SIZE];}hid_rpt01={
0x06, 0xA0, 0xFF, // Usage page (vendor defined)
0x09, 0x01, // Usage ID (vendor defined)
0xA1, 0x01, // Collection (application)
0x85, 0x01,
// The Input report
0x09, 0x03, // Usage ID - vendor defined
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x75, 0x08, // Report Size (8 bits)
0x95, 0x02, // Report Count (2 fields)
0x81, 0x02, // Input (Data, Variable, Absolute)

// The Output report
0x09, 0x04, // Usage ID - vendor defined
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x75, 0x08, // Report Size (8 bits)
0x95, 0x02, // Report Count (2 fields)
0x91, 0x02, // Output (Data, Variable, Absolute)

// The Feature report
0x09, 0x05, // Usage ID - vendor defined
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x75, 0x08, // Report Size (8 bits)
0x95, 0x02, // Report Count (2 fields)
0xB1, 0x02, // Feature (Data, Variable, Absolute)

0xC0,
//
0x09, 0x06, /* Usage (Keyboard) */
0xA1, 0x01, /* Collection (Application) */
0x85, 0x02, /* Report ID */
0x05, 0x07, /* Usage (Key codes) */
0x19, 0xE0, /* Usage Minimum (224) */
0x29, 0xE7, /* Usage Maximum (231) */
0x15, 0x00, /* Logical Minimum (0) */
0x25, 0x01, /* Logical Maximum (1) */
0x75, 0x01, /* Report Size (1) */
0x95, 0x08, /* Report Count (8) */
0x81, 0x02, /* Input (Data, Variable, Absolute) */
0x95, 0x01, /* Report Count (1) */
0x75, 0x08, /* Report Size (8) */
0x81, 0x01, /* Input (Constant) ;5 bit padding */
0x95, 0x05, /* Report Count (5) */
0x75, 0x01, /* Report Size (1) */
0x05, 0x08, /* Usage Page (Page# for LEDs) */
0x19, 0x01, /* Usage Minimum (01) */
0x29, 0x05, /* Usage Maximum (05) */
0x91, 0x02, /* Output (Data, Variable, Absolute) */
0x95, 0x01, /* Report Count (1) */
0x75, 0x03, /* Report Size (3) */
0x91, 0x01, /* Output (Constant) */
0x95, 0x06, /* Report Count (1) */
0x75, 0x08, /* Report Size (3) */
0x15, 0x00, /* Logical Minimum (0) */
0x25, 0x65, /* Logical Maximum (101) */
0x05, 0x07, /* Usage (Key codes) */
0x19, 0x00, /* Usage Minimum (00) */
0x29, 0x65, /* Usage Maximum (101) */
0x81, 0x00, /* Input (Data, Array) */
0xC0}; /* End Collection,End Collection */
Innovative
Newbie
 
Posts: 10
Joined: Thu Jan 27, 2011 1:11 pm

Re: PR26 (Build Failed)

Postby A380 » Thu Sep 08, 2011 5:49 pm

Innovative WROTE:I have change the descriptor to HID output + Keyboard as below but when i plug in it shown yellow bang in the device list.
BtW, do you know how to configure the VID and PID? for the working mouse + keyboard if i change the VID / PID then the device will not be working anymore.


Did you change this "HID_RPT01_SIZE" value in usb_config.h? HID_RPT01_SIZE is the size of your USB descriptor (located at usb_descriptors.c). One byte counted as one. For example, (0x09, 0x06, 0xA1, 0x01), the size is 4. You need to count it start from /* Usage (Keyboard) */ to /* End Collection,End Collection */

/* HID */
#define HID_INTF_ID 0x00
#define HID_EP 1
#define HID_INT_OUT_EP_SIZE 1
#define HID_INT_IN_EP_SIZE 8
#define HID_NUM_OF_DSC 1
#define HID_RPT01_SIZE 63
#define USER_SET_REPORT_HANDLER USBHIDCBSetReportHandler


I think we don't need to specify the VID/PID. May be you can try to change both of it.
User avatar
A380
Discoverer
 
Posts: 120
Joined: Tue May 19, 2009 2:44 pm
Location: Malaysia

Re: PR26 (Build Failed)

Postby Innovative » Fri Sep 09, 2011 12:12 am

Ya, I have change it accordingly but it still shown the yellow bang.
BTW, if I try to change the PID and VID also will get the error yellow bang, do you have any idea how to configure the PID and VID?

Thank you!!
Innovative
Newbie
 
Posts: 10
Joined: Thu Jan 27, 2011 1:11 pm

Re: PR26 (Build Failed)

Postby A380 » Fri Sep 09, 2011 5:31 pm

As I know, the VID/PID is just for PC recognize whether this device has been installed before or not.

How about you remain VID = 0x04D8 (Microchip VID), and change PID.
User avatar
A380
Discoverer
 
Posts: 120
Joined: Tue May 19, 2009 2:44 pm
Location: Malaysia

Previous

Return to DIY Project Set

Who is online

Users browsing this forum: No registered users and 6 guests