USB programming

前端 未结 10 1801
不思量自难忘°
不思量自难忘° 2021-01-30 11:19

I want to program a microcontroller (AVR) to control some leds through USB. It\'s just out of interest in how to build and program USB devices. There are some AVR microcontrolle

相关标签:
10条回答
  • 2021-01-30 11:56

    I wonder what to use to write your own drivers on the computer

    1. libusb (here, here and here)
    2. wdk
    3. WinDriver

    For libusb variants info read this

    0 讨论(0)
  • 2021-01-30 11:58

    You could us libusb. It's powerful and cross-platform.

    But what you're trying to do is a rather simple control interface. You can sidestep most of the complexity by using HIDAPI, I think.

    http://www.signal11.us/oss/hidapi/

    HID devices often use generic drivers that come packaged into the OS. That way you don't actually have to write any drivers ever, you just make your device compliant with the generic driver and tailor the client software to it.

    I think this is what's usually done in the hobbyist electronics field, which is what you're interested in here.

    HIDAPI is even recommended for simple communications with HID devices in the libusb FAQ since its a bit more complicated to do it across platforms using libusb.

    0 讨论(0)
  • 2021-01-30 12:10

    Well, although you can develop and write your own USB driver, the beauty of USB is that you don't need to write your own driver. the USB Implementers Forum has defined class specifications for all the standard device classes. If you can make your device fit into a standard device class the driver has already been written for you!

    If you truly want to become familiar with USB development, you should start by reviewing the USB approved class specification documents.

    0 讨论(0)
  • 2021-01-30 12:12

    I had built my own test bed based on the ARDUINO UNO and i was using the ionlabs programmer of type usbasp and it worked perfectly fine but it did not allow to convert the TTL back to Rs-232 and hence i couldn't use the features such as serial.print() and i had to install the ftdi cable which allowed me to do this. The drivers were the libusb 1.xx working just fine.

    If you want to program the AVR you can use the ARDUINO software bundle or the stino to upload the programs. You need to know c(only basics).

    0 讨论(0)
  • 2021-01-30 12:14

    The Microsoft documentation area of the WDK (Windows Development Kit) is recently available on MSDN. There is a section on USB, though you would be best to read the earlier sections first, in particular the "Getting Started" areas. They assume you'll be using C as the programming language for driver development.

    • WDK Site
    • WDK - USB Section

    For Linux, the Linux USB website should be able to point you in the right direction. In particular you'll want the Programming Guide for Linux USB Device Drivers.

    0 讨论(0)
  • 2021-01-30 12:16

    If you are into framework for AVR microcontrollers with hardware USB then take a look into LUFA, and if you are into AVRs with software USB then look into V-USB. They have both implemented many USB classes so you don't have to do it on your own - just use them.

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