Standalone Arduino <-> computer communication

Hy,

I wounder if someone could help me with this one: I´m planning to build a joystick with 4 pots, 7 buttons and one POV hat (hat switch). I would like to use only one Atmega8 for the project, but I have no clue how I could communicate with my computer. One option would be to use the arduinos built in serial-to-usb chip, but I would like to only use an Atmega8. How can I do that, or is it even possible to do so?

Hasi321:
Hy,

I wounder if someone could help me with this one: I´m planning to build a joystick with 4 pots, 7 buttons and one POV hat (hat switch). I would like to use only one Atmega8 for the project, but I have no clue how I could communicate with my computer. One option would be to use the arduinos built in serial-to-usb chip, but I would like to only use an Atmega8. How can I do that, or is it even possible to do so?

Get a PC USB to serial cable then use the Arduino serial port.

Hi

Toward the bottom of his explanation on how to make a standalone Arduino with a 328, Nick Gammon explains how to hook up a FTDI cable or breakout to it. This can be used to communicate serially (via USB) with your PC.

link to page

I've not used the ATMega8 but it's in the same family, and pin-compatible with the 328.

I'd look into that, Geoff

Making a Arduino become a joystick or a similar HID compliant Device is more than just hooking the Arduino to the computer via. a standard USB to Serial converter while it is needed to connect your Arduino to the computer but you need to run a HID stack over your uC for that you can goto V-USB(google it!) and you would be able to just use your ATmega8 and make it into a HID device.

Hasi321:
Hy,

I wounder if someone could help me with this one: I´m planning to build a joystick with 4 pots, 7 buttons and one POV hat (hat switch). I would like to use only one Atmega8 for the project, but I have no clue how I could communicate with my computer. One option would be to use the arduinos built in serial-to-usb chip, but I would like to only use an Atmega8. How can I do that, or is it even possible to do so?

Do you want to build a serial or USB based joystick? Serial would be relatively easy to build, you just need to add something like a MAX232 or equivalent chip to translate from the Atmega's 5V to the required +- 12V as required for serial communication. This is probably a dead end though since serial ports are quite scarce on modern computers.

You could build a USB based mouse by implementing the HID interface for a mouse using the V_USB library (http://www.obdev.at/products/vusb/index.html). An Arduino port of this library can be found at Google Code Archive - Long-term storage for Google Code Project Hosting.. This will be a little bit more tricky and will require some internet searching for examples to adapt. Some examples can be found at http://www.obdev.at/products/vusb/prjhid.html but are not specifically adapted to the Arduino environment.

If you don't already have the Atmega I would suggest the Arduino compatible Teensy or Teensy++ boards. These also use Atmel micro controllers but have a much improved USB inteface compared to the "standard" Atmega boards.
http://www.pjrc.com/teensy/
Te Teensyduino software plugin for the Arduino IDE will provide you with many more examples, including some for a USB Joystick. The Teensys also have much smaller footprint comparable to a Arduino Nano for the Teensy++. For a joystick application the even smaller Teensy should be fine and only costs $16.

Christo:
Do you want to build a serial or USB based joystick? Serial would be relatively easy to build, you just need to add something like a MAX232 or equivalent chip to translate from the Atmega's 5V to the required +- 12V as required for serial communication. This is probably a dead end though since serial ports are quite scarce on modern computers.

You could build a USB based mouse by implementing the HID interface for a mouse using the V_USB library (http://www.obdev.at/products/vusb/index.html). An Arduino port of this library can be found at Google Code Archive - Long-term storage for Google Code Project Hosting.. This will be a little bit more tricky and will require some internet searching for examples to adapt. Some examples can be found at http://www.obdev.at/products/vusb/prjhid.html but are not specifically adapted to the Arduino environment.

That's what I was searching for. I wanted to make a USB based joystick. I took a look at the links and it sound extremely complicated. I'll try to read more about USB connection, maybe that way I can understand a bit more from, how I should adapt and configure it the right way...