Pages: [1]   Go Down
Author Topic: Standalone Arduino <-> computer communication  (Read 1029 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5665
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

ਪੰਜਾਬ
Offline Offline
Edison Member
*
Karma: 12
Posts: 1618
Another year! Alone! :(
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

"Real Men can Accomplish  Anything"
-  Website  
- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੂਂ !

South Africa
Offline Offline
Newbie
*
Karma: 1
Posts: 47
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 http://code.google.com/p/vusb-for-arduino/.  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.
Logged

Offline Offline
Sr. Member
****
Karma: 7
Posts: 292
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 http://code.google.com/p/vusb-for-arduino/.  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...
Logged

Pages: [1]   Go Up
Jump to: