Sending and receiving data over USB port

后端 未结 4 1337
旧时难觅i
旧时难觅i 2021-01-03 08:02

I\'d like to send/receive data over a USB port to a device (from my vista pc). Is there a free/cheap library out there that can do this, and how involved would this project

相关标签:
4条回答
  • 2021-01-03 08:19

    This article in Code project may be a good start for you. At first you need to build your device. You can either use a micro-controller with a USB port or you can use a serial-to-USB chipset (like the already suggested FTDI).

    You should avoid writing your own USB library-driver. The article in the CodeProject uses the HDI driver, which is already present in your device. It uses a PIC micro-controller, but my personal favourite is AVR. With AVR you have the following options:

    • AVR-USB: Implements USB stack in firmware. Drivers, examples for all platforms. Any AVR micro can be used. You may need to build the hardware yourself.
    • Atmel's USB family. These are microcontrollers with USB port. Drivers and ready to buy kits are available. Other manufacturers (like Microchip's PIC family) have similar solutions.
    0 讨论(0)
  • 2021-01-03 08:37

    You don't specify what's going on here. Does the device already exist? Is it already a USB device?

    If you already have a USB device, then the manufacturer should be able to help.

    If you are building the device, then you might want to look at something like a USB to serial adapter (which generally require no special drivers at all) or something from FTDI - they make a number of easy-to-use USB chips that generally don't need, or come with appropriate drivers under windows. I've worked with their chips on a couple of occasions and they've never given me any trouble.

    0 讨论(0)
  • 2021-01-03 08:44

    libusb-win32 maybe?

    0 讨论(0)
  • 2021-01-03 08:44

    Without knowing anything else about your situation, and assuming you are in control of the device's USB protocol and drivers, I would recommend using WinUSB.

    It is a lot better than libusb-win32 because it is a native part of Windows and it supports asynchronous communication. Also, libusb-win32 only supports the libusb-0.1 API, which is really old.

    0 讨论(0)
提交回复
热议问题