5

I wonder which hardware will be the best for playing with USB because its looks like a lot of projects only use atmega8 (or even attiny). But would it really be easier with an AT90USB which have the built-in USB?

I have already looked at some HID libraries (lufa, avr-usb, v-usb…) but they are complex. Does anyone have a link to a specific project or a one-case explanation of the USB implementation?

For the details : I would like to make a ~25 button joystick and I work on linux.

Trygve Laugstøl
  • 1,410
  • 2
  • 19
  • 28
jojo l'abricot
  • 261
  • 3
  • 7

3 Answers3

7

Have a look at these questions:

How to build a USB controller having knobs, sliders, and switches

Teensy development

I'd like to learn how to make my own USB gadgets

I would use a Teensy, here are some links to projects

Toby Jaffey
  • 28,796
  • 19
  • 96
  • 150
5

The easiest way to interact with an AVR over USB would be to connect an FTDI FT232 to the UART, and then interact with your AVR as a virtual COM port using the FTDI drivers.

You've probably heard of or used this chip; it's on a lot of embedded devices (Including the Arduino boards) and it's probably the easiest way to interact with a microcontroller over USB. However, I'm not sure that it can do what you're trying to do; it creates a virtual COM port. If you can write a plugin to query the device for button presses, it will be ideal. However, if you want it to show up as an input device, I'm not sure that this is the solution for you.

Edit: This is the plug-in simple solution to get basic communication. Joby's answer does not restrict your project to a virtual COM port as this device does.
However, the port provided can be made to function in the same way with inputattach. (Source: Joby's comment below) However, it appears that you will have to patch your device driver into the inputattach utility.

Kevin Vermeer
  • 19,989
  • 8
  • 57
  • 102
  • 1
    I would definitely recommend the FTDI solution as a fast and cost-effective solution for any one-off project. (It's not clear if your joystick is a one-off or slated for 10k units!) A particularly nice version is their "USB-TTL cable" (about $20) which looks like a USB cable on one end, with a header or bare wires on the other end, and contains the USB chip inside. This cable is used as the USB solution for many popular boards including the Arduino Lilypad and Arduino Pro. – Windell Oskay Aug 09 '10 at 19:00
  • 1
    If you do go down this route, you may still want your joystick to appear as a proper joystick driver in linux. You can do this with inputattach http://wiki.archlinux.org/index.php/Attaching_serial_input_devices_to_the_kernel_input_system – Toby Jaffey Aug 09 '10 at 19:07
1

AVR based 25 buttons joystick programmable from linux can be one of those projects: http://www.obdev.at/products/vusb/prjhid.html. USB has many standard device classes, and HID is one of them, convenient for keyboards, mices and joysticks, especially since all operating systems support it, which means that you don't have to provide driver for your device. You don't need to know the low level side of USB/HID if you use such example projects, but you can find a lot of info at USB official site and documentation.

avra
  • 1,872
  • 3
  • 14
  • 21