USB HID Initialize
Posted: Mon Jul 01, 2013 8:16 am
Hi,
I have a project using the PIC18F2550. I'm trying to get the USB HID to initialize.
As I understand the help file, Initialise_HID() will return 0 it the startup was successful and 255 if the startup failed or timed-out.
My problem is that Initialise_HID() is not returning anything. The code just stops when it gets to the initialise_HID() macro. I can deal with it not enumerating and returning 255, but can't figure out why it is not returning anything at all.
My descriptor file is as follows:
0x06,0xA0,0xFF, //Usage Page - Vendor Defined
0x09,0x01, //Usage - Vendor Defined
0xA1,0x01, //Collection - Application
0x09,0x02, //Usage - Vendor Defined
0xA1,0x00, //Collection - Linked
0x06,0xA1,0xFF, //Usage Page - Buttons
0x09,0x03, //Usage - Vendor Defined
0x09,0x04, //Usage - Vendor Defined
0x15,0x00, //Logical Minimum - 0
0x26,0xFF,0x00, //Logical Maximum - 255
0x35,0x00, //Physical Minimum - 0
0x45,0xFF, //Physical Maximum - 255
0x75,0x08, //Report Size - 8bits
0x95,0x03, //Report Count - 3fields
0x81,0x02, //Input - Data Variable Absolute
0x09,0x05, //Usage - Vendor Defined
0x09,0x06, //Usage - Vendor Defined
0x15,0x00, //Logical Minimum - 0
0x26,0xFF,0x00, //Logical Maximum - 255
0x35,0x00, //Physical Minimum - 0
0x45,0xFF, //Physical Maximum - 255
0x75,0x03, //Report Size - 8bits
0x95,0x08, //Report Count - 3fields
0x91,0x02, //Output - Data Variable Absolute
0xC0, //End Collection
0xC0 //End Collection
I copied the customized descriptor property from an example posted by Benj here. http://www.matrixmultimedia.com/mmforum ... tor#p13074
Do I need to modify the "Customized code" screen since I am using a custom descriptor property? If so, what should the custom code properties be?
I have attached a file with a snippet of the applicable code(without project settings, etc.} All of the rest of my code(which I have not included in the uploaded file) works fine. If there are some settings to fiddle with please let me know. Thanks.
I have a project using the PIC18F2550. I'm trying to get the USB HID to initialize.
As I understand the help file, Initialise_HID() will return 0 it the startup was successful and 255 if the startup failed or timed-out.
My problem is that Initialise_HID() is not returning anything. The code just stops when it gets to the initialise_HID() macro. I can deal with it not enumerating and returning 255, but can't figure out why it is not returning anything at all.
My descriptor file is as follows:
0x06,0xA0,0xFF, //Usage Page - Vendor Defined
0x09,0x01, //Usage - Vendor Defined
0xA1,0x01, //Collection - Application
0x09,0x02, //Usage - Vendor Defined
0xA1,0x00, //Collection - Linked
0x06,0xA1,0xFF, //Usage Page - Buttons
0x09,0x03, //Usage - Vendor Defined
0x09,0x04, //Usage - Vendor Defined
0x15,0x00, //Logical Minimum - 0
0x26,0xFF,0x00, //Logical Maximum - 255
0x35,0x00, //Physical Minimum - 0
0x45,0xFF, //Physical Maximum - 255
0x75,0x08, //Report Size - 8bits
0x95,0x03, //Report Count - 3fields
0x81,0x02, //Input - Data Variable Absolute
0x09,0x05, //Usage - Vendor Defined
0x09,0x06, //Usage - Vendor Defined
0x15,0x00, //Logical Minimum - 0
0x26,0xFF,0x00, //Logical Maximum - 255
0x35,0x00, //Physical Minimum - 0
0x45,0xFF, //Physical Maximum - 255
0x75,0x03, //Report Size - 8bits
0x95,0x08, //Report Count - 3fields
0x91,0x02, //Output - Data Variable Absolute
0xC0, //End Collection
0xC0 //End Collection
I copied the customized descriptor property from an example posted by Benj here. http://www.matrixmultimedia.com/mmforum ... tor#p13074
Do I need to modify the "Customized code" screen since I am using a custom descriptor property? If so, what should the custom code properties be?
I have attached a file with a snippet of the applicable code(without project settings, etc.} All of the rest of my code(which I have not included in the uploaded file) works fine. If there are some settings to fiddle with please let me know. Thanks.
