This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to learn USB

Hi,

Maybe it's not a question. Actually,it's a  method to learn things. I have download USB_develop Packet and read it's API user guide . Also i read F5529 USB section and have a F5529 lauchpad on hand.  I just download USB examples of USB_develop Packet ,run them and successful show it's function. But i still confuse in how to use it. In which way can i learn it or what's the step should i do.Think you very much if you provide some advice.

  • The various USB protocols are horribly complex.

    You have to read the USB specification, and any device class specification that applies to your device. (Warning: these documents were written by committees. All hope abandon, þe who enter here.)

    Also read the documentation of the USB module (chapter 42 of the User's Guide).

    There are books about USB, but I cannot recommend any of them.
  • Thanks for your reply.   I use demo of  H1_LedOnOFF to do experiment.Now, I want change endpoint,how to do it.   

  • What property of the endpoint do you want to change?
  • In H1_LedOnOFF demo,it use EP0 and EP1. So I want to use EP0 and EP2 to instead,which place should i change. Is that easy to change?  I try change something in file descriptors.h,but failed to echo data on GUI------MSP430 HID USB Application.I think there must be something wrong. So is there a document to guide us how to do easy change in application uses.

  • There is no symbol named "something" in the descriptors.h file.

    You need to change HID0_OUTEP_ADDR, HID0_INEP_ADDR, USB_OUTEP_INT_EN, and USB_INEP_INT_EN in the .h file, and the edb_Index and ?ep_?_Buffer fields in the stUsbHandle array in the .c file.

    I guess the USB Descriptor Tool will not support such a configuration.
  • Yes, USB Descriptor Tool can't do this.

    Here is a picture my friend show me.What does it means?  It looks like EP1 for OUT and EP2 for IN?

  • Hi, I do what as you say. May i ask about the vlaue of edb_Index? In the demo it's value is 0 and what it should be if i use EP2.

    Here is the change list.

    1.

    /************************descriptors.h*****************************************/

    #define HID0_OUTEP_ADDR    0x02
    #define HID0_INEP_ADDR        0x82

    #define USB_OUTEP_INT_EN    BIT0 | BIT2
    #define USB_INEP_INT_EN        BIT0 | BIT2

    /*******************************************************************************/

    2.

    /****************************descriptors.c**************************************/

    const struct tUsbHandle stUsbHandle[]=
    {
       {
          HID0_INEP_ADDR,
          HID0_OUTEP_ADDR,
          0,
          HID_CLASS,
          0,
          0,
          OEP2_X_BUFFER_ADDRESS,
          OEP2_Y_BUFFER_ADDRESS,
          IEP2_X_BUFFER_ADDRESS,
          IEP2_Y_BUFFER_ADDRESS
      }

    };

    /********************************************************************/

    3.

    In file UsbIsr , i move EP1 handle program to EP2 unchanged.

    /******************************end of change list***************************************/

    Above is the info of device run changed demo  shows.

    When i use GUI to send command LED ON!   It says 

    Connected to device VID: 8263 PID: 769
    TX-->LED ON!
    Unable to send buffer!

    So there still some things i missed maybe.  

  • edb_Index is the index in the USB buffer descriptor register array, i.e., the endpoint number minus one. It's used for both endpoints, so TI's USB stack does not support the output and input endpoints of a single HID interface to have different endpoint numbers.

  • Thank you so much. I successfully use EP2 with your help. Thank you again.

**Attention** This is a public forum