5
\$\begingroup\$

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.

\$\endgroup\$
7
\$\begingroup\$

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

\$\endgroup\$
5
\$\begingroup\$

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.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – Windell Oskay Aug 9 '10 at 19:00
  • 1
    \$\begingroup\$ 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 wiki.archlinux.org/index.php/… \$\endgroup\$ – Toby Jaffey Aug 9 '10 at 19:07
1
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.