![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
young
Joined: 24 Jun 2004 Posts: 285
|
How to change the usb descriptor? |
Posted: Thu Jan 27, 2005 3:28 pm |
|
|
I am using the ex_usb_hid.c example from the ccs. the sample so far working fine.
I want to change the Transfer and Receive data bytes. I saw in the sample file, if I want to do that I have to change the usb description,
Quote: |
#define USB_EP1_TX_ENABLE 1 //turn on EP1 for IN bulk/interrupt transfers
#define USB_EP1_TX_SIZE 2 //if you change this, be sure to change the hid descriptor
//the following defines needed for the CCS USB PIC driver to enable the RX endpoint 1
#define USB_EP1_RX_ENABLE 1 //turn on EP1 for OUT bulk/interrupt transfers
#define USB_EP1_RX_SIZE 2 //if you change this, be sure to change the hid descriptor |
I want to the file provide by ccs, and find out the usb_desc.c file, but I do not know how to change it.
for example, if I want to
#define USB_EP1_TX_SIZE 20 ( this number is secret to me, what is the maximum number for me to define here
and
#define USB_EP1_RX_SIZE 2
How accordingly, I should change the usb desceiption?
Thank you! |
|
![](templates/subSilver/images/spacer.gif) |
young
Joined: 24 Jun 2004 Posts: 285
|
|
Posted: Thu Jan 27, 2005 5:38 pm |
|
|
I looked into the usb_desc.h file and changed here
Code: |
BYTE CONST USB_HID_DESC[] = { //len=28
6, 0, 255, // Usage Page = Vendor Defined
9, 1, // Usage = IO device
0xa1, 1, // Collection = Application
0x19, 1, // Usage minimum
0x29, 8, // Usage maximum
0x15, 0x80, // Logical minimum (-128)
0x25, 0x7F, // Logical maximum (127)
0x75, 8, // Report size = 8 (bits)
0x95, 2, // Report count = 16 bits (2 bytes)
0x81, 2, // Input (Data, Var, Abs)
0x19, 1, // Usage minimum
0x29, 8, // Usage maximum
//***********************************************************
0x91, 8, // Output (Data, Var, Abs) //changed to 8 original is 2
//***********************************************************
0xc0 // End Collection
};
|
after I compiled the program, windows could not recognize, and said this is a new device.
please help |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
|
Posted: Thu Jan 27, 2005 9:53 pm |
|
|
young wrote: | I looked into the usb_desc.h file and changed here
Code: |
BYTE CONST USB_HID_DESC[] = { //len=28
6, 0, 255, // Usage Page = Vendor Defined
9, 1, // Usage = IO device
0xa1, 1, // Collection = Application
0x19, 1, // Usage minimum
0x29, 8, // Usage maximum
0x15, 0x80, // Logical minimum (-128)
0x25, 0x7F, // Logical maximum (127)
0x75, 8, // Report size = 8 (bits)
0x95, 2, // Report count = 16 bits (2 bytes)
0x81, 2, // Input (Data, Var, Abs)
0x19, 1, // Usage minimum
0x29, 8, // Usage maximum
//***********************************************************
0x91, 8, // Output (Data, Var, Abs) //changed to 8 original is 2
//***********************************************************
0xc0 // End Collection
};
|
after I compiled the program, windows could not recognize, and said this is a new device.
please help |
This is not correct.
It sounds like you need to read the USB spec. It's availble for free, do a google search. |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
|
Posted: Fri Jan 28, 2005 7:31 am |
|
|
any idea where and how I should change the USB descriptor or may be I do not even need to change, but how I can set more data instead of just 2 bytes a time. |
|
![](templates/subSilver/images/spacer.gif) |
young
Joined: 24 Jun 2004 Posts: 285
|
|
Posted: Fri Jan 28, 2005 9:52 am |
|
|
I found it, it should be
0x95, 2, // Report count = 16 bits (2 bytes) |
|
![](templates/subSilver/images/spacer.gif) |
young
Joined: 24 Jun 2004 Posts: 285
|
|
Posted: Fri Jan 28, 2005 10:23 am |
|
|
I did with the usb_put_packet(ep1,data,8);
how can i sent data message more than 8 for example 20,or 30 bytes,
I tried usb_puts(ep1,data,30,8,10);
I just received the first 8 bytes, I did not receieve the following bytes, why
did I use usb_puts wrong? |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
|
Posted: Fri Jan 28, 2005 11:59 am |
|
|
any suggestions? |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
|
Posted: Fri Jan 28, 2005 1:47 pm |
|
|
I found a solution by sending data packet by packet. anyway, I did not find out usb_puts working if any one success to do that, please let me know. |
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|