How to send/receive a byte to/from a USB port?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • opkarmalkar
    New Member
    • May 2010
    • 3

    How to send/receive a byte to/from a USB port?

    I want to interface 8051 mcu to pc using USB port.
    I want to know that how can i send/receive a byte from pc to 8051 mcu via USB port using C language?

    is there any C program availaible which can write data on usb port as well as read data from USB port?

    Please help
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    You don't read/write to/from a USB port, you have a device connected through a driver in the USB driver stack.

    It is not like a serial port you can just open and write to.

    What interface you you plan to use/is there on the 8051 board?

    Comment

    • opkarmalkar
      New Member
      • May 2010
      • 3

      #3
      i m just plannig to attach a manipulator.... in more sipmle words, there will be 4 or 5 motors which will rotate clockwise or counterclockwis e accrding to keys pressed on keyboard. This program will be in C & read the user input from keyboard & just send it on a USB port. On this port there will be a USB to UART bridge which will send data to serial port of 8051.

      But i dont know is how to send hex code of key (which is pressed) on a USB port.

      Also i want to know how to take input from USB port using C language.

      Comment

      • opkarmalkar
        New Member
        • May 2010
        • 3

        #4
        Originally posted by Banfa
        You don't read/write to/from a USB port, you have a device connected through a driver in the USB driver stack.

        It is not like a serial port you can just open and write to.

        What interface you you plan to use/is there on the 8051 board?
        i m just plannig to attach a manipulator.... in more sipmle words, there will be 4 or 5 motors which will rotate clockwise or counterclockwis e accrding to keys pressed on keyboard. This program will be in C & read the user input from keyboard & just send it on a USB port. On this port there will be a USB to UART bridge which will send data to serial port of 8051.

        But i dont know is how to send hex code of key (which is pressed) on a USB port.

        Also i want to know how to take input from USB port using C language.

        Comment

        • newb16
          Contributor
          • Jul 2008
          • 687

          #5
          If there is a usb to serial bridge, there must be a driver provided by the bridge manufacturer, that makes the bridge appear like a serial port to application software. So you do not need to interact with USB, only with the serial port.

          Comment

          Working...