Shop OBEX P1 Docs P2 Docs Learn Events
Will the Hydra ever adapt to a USB game controller? — Parallax Forums

Will the Hydra ever adapt to a USB game controller?

LoopyBytelooseLoopyByteloose Posts: 12,537
edited 2007-03-11 17:18 in Propeller 1
Though I am quite happy without the USB controller at this time, the NES controllers are not easily available in Taiwan.· Obviously with NES, you have the opportunity to built a DIY controller.

But once again I suspect it is a case of Taiwan eliminating unwanted inventories to countries that buy their surpluses.·· In some cases, I suspect other countries never had NES and never will.

So, I am wondering if the Hydra will ever develop [noparse][[/noparse]possibly a card] USB interface to support more ubiquitous game input devices?· Similarly, I envision that many users would like the Propeller to support such a device rather than have to build joystick inputs.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

Comments

  • Michael PopoloskiMichael Popoloski Posts: 42
    edited 2007-02-25 13:56
    You could always try something like the GameCube controller, which is what I am going to be doing for my project. There is even a topic on it right now over in the Propeller forum, with a link by Cj containing a driver. You have GameCube controllers over there, right?

    As for USB, I think it would be difficult for the HYDRA seeing as how everything is already soldered onto the board. You could definitely create your own board utilizing USB, but then it wouldn't be the HYDRA.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-02-25 15:23
    Parallax is selling a USB Host chip, the FTDI Vinculum [noparse][[/noparse]$12 USD each] that could do the job. The problem is the firmware for that part. It will talk to the Propeller in RS232 format serial to 1M baud or in SPI [noparse][[/noparse]sorry, no I2C bus].

    The component also is 3.3volts and uses about 25ma.

    Having said that. It seems we already have the UART object in SPIN. So it is entirely a matter of the creation of firmware and an ever so tiny board to plug into the Hydra's game cartrige port. EEPROM can be included on the device. The Vinculum can host 2 game controllers as well!

    The Vinculum can be reconfigured through the UART and an on-board boot program as well.

    In sum, the hardware is all there. We just need a Vinculum/USB Game Controller work group to evolve firmware and programing proceedure.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • AndreLAndreL Posts: 1,004
    edited 2007-02-27 19:45
    Also, remember the hydra already has a USB mini-b connector on it with a serial UART, so you can always plug something in there and just write the driver for it as well

    Andre'
  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-27 20:08
    Andre,
    That won't work. The Hydra's USB connector is for a USB to serial adapter which can't be used as a USB host. The only thing you can plug in there is a cable to a PC (host controller). The same thing is true for the PropPlug / PropStickUSB / Demo Board / USB2SER / Protoboard, etc. The only USB host controllers available that would easily work with the Propeller are the Vinculum and GHI Electronics units.
  • AndreLAndreL Posts: 1,004
    edited 2007-02-27 21:22
    Not true, if you have a serial usb device in the first place that send standard serial, like a mouse, or keyboard, you can get it to work since its not a USB device per se. But, yes, you are correct a true USB device can't be hosted by the hydra or the demo board since they just use serial uarts with the USB connector more or less.

    Andre'
  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-28 01:25
    Most USB mice and keyboards don't appear as serial devices to the host. They are known as HID (Human Interface Devices) and communicate via device registers (real or virtual). There are some older mice and keyboards that attempt to detect whether they're connected to a PS/2 or USB socket and adjust their communications to suit. These always come with a PS/2 to USB adapter and are clearly marked as compatible with PS/2. You'd plug them into the PS/2 connectors on the Hydra and use the usual PS/2 drivers. They won't work if plugged into the USB connector.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-02-28 14:17
    It may help to clarify why I think the USB Game Controller I/O is important. Mice and Keyboards are trivial.

    I was watching a research vessel using and underwater ROV on either the Discovery or National Geographic channel recently.

    Low and behold, the operator was using a Sony Playstation II set to control this quite exotic and expensive device. I realized that I really don't need to spend money on DIY joysticks and such to get the kind of device that really can do such tasks. There are many off-the-shelf devices that will do just fine -- if they can talk to the Hydra or Propeller chip.

    In actuality, any game HID device would be useful not only for games, but for remote control, robotic work, and/or graphic rendering.

    I will consider the possiblity of using the existing USB slave port, but it would be nice to have a pair of USB hosts available for games. Also, I see now that the PS/2 appears to be not the same as USB. If PS/2 is easier, more direct; I guess that is the way to go.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • AndreLAndreL Posts: 1,004
    edited 2007-03-01 03:02
    If you want to inteface HID USB devices then you need a real USB host chip that can handle it as host. Try the AVR USB chips, 100x better, easier and code for joysticks, mice, keyboards, drives, etc. come with the kit. Put one right on the expansion card of the hydra, along with a USB port and you can make it work, not simple, but a lot easier than the viniculum to get working. The AVR stuff is REALLY slick, also you get a complete microcontroller as well with the AVR usb stuff. To get started you can get the AT90USB kit for $49-99, plugs into your PC, very slick, then once you get the hang, you can make one yourself.

    Andre'
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-03-01 13:11
    Thanks, I had not considered another USB host device being available [noparse][[/noparse]assume the AVR usb had no host feature].

    The Viniculum includes a microcontroller within its package, but I cannot seem to currently find any public documents on programing. They appear to be conservative and hush hush. It may be they service the industry and don't want the public hacking their products.

    I did look at the various HID USB devices and there are a lot. Most are copies of the Sony DualShock. Some feature analogue joysticks [noparse][[/noparse]same as Sony]. Since there are also about 10 buttons on these, I look forward to one day having a way to integrate them with the Hydra.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • A.C. fishingA.C. fishing Posts: 262
    edited 2007-03-02 23:29
    Probably this sounds ridiculous, but would a host chip be neccessary? Consider the fact that the 5 Volt USB wire(red) could plug into the prop's 5 Volts, and its black wire to VSS, and the white and green wires(I assume these are communication wires) be plugged directly into the prop's IOs?
    I think a USB driver for the propellor would be as big a step as the Hydra itself. The propellor would be able to communicate with Flash Drives, Microphones, USB mice, USB keyboards, wireless Adapters, webcams(might be too fast?), and almost anything. Considering that the world seems to be moving towards USB I think it is a must for a propellor interface.
    ACfishing

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Somebody said...
    -Never Underestimate the power of human stupidity.
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-03 00:08
    ACfishing,
    The issue is allocation of resources. The current Propeller has 32K of main memory and a couple of K of cog memory. USB hosting is complicated. On top of the low level USB code (which runs quite fast, particularly with USB2.0) each I/O device has to have a driver. At the very least, you're talking about devoting pretty much a whole Propeller to just handling USB. A Propeller with some basic external circuitry (like the Protoboard) costs about $25 dollars in small quantities. A complete USB host with I/O drivers for common devices (mass storage, HID, and serial I/O) can be bought for roughly twice that. This includes amortized development cost and these are commercial products with support available.

    It's really hard to justify doing this with a Propeller when you can buy someone else's tested version.

    To compare ... I've been using Rokicki's FAT file driver on the Propeller. It's very nice, very cheap (just need an SD card socket). On the other hand, it takes quite a bit of memory to implement. It's a very incomplete implementation. In particular, it doesn't support directories at all while most commercial SD card interfaces do support them. Keep in mind that USB hosting is much much more complicated.
  • lnielsenlnielsen Posts: 72
    edited 2007-03-07 14:43
    Why go the USB route when you can go wireless? I just got a Logitech PS2 controller and will be interfacing the 2.4Ghz dongle to my protoboard. But in the long run I think the future is with Bluetooth since both the PS3 and WII controllers use that. SparkFun has a couple of Bluetooth 2.0 modules that should work http://www.sparkfun.com/commerce/product_info.php?products_id=148. I don't think the 2.4Ghz RF units are very standardized for the Logitech or the Nintendo WaveBird controllers

    There are a few sites out here that are reverse engineering these controllers. The biggest issue so far seems to be enabling the motion detection features. See http://www.wiili.org/index.php/Wiimote and http://www.dcemu.co.uk/vbulletin/showthread.php?t=45209

    I will be using the same controller to play games on my HYDRA clone and to control my Propeller run Bioloid robot.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-03-11 17:18
    Wireless is an option. Bluetooth is likely to be as big a hassle as USB [noparse][[/noparse]or bigger] as it too has proprietary drivers.

    I have considered merely hacking a GameController to deal with a simple synchonous serial interface.

    The only reason to go the USB route is that there is a wide selection of DualShock and other game controller devices that use the interface. I was thinking that the USB interface would broaden the user base for the Hydra and the Propeller as many overseas locations do not have all the variety that the USA has.

    For instance, being in Taiwan I can no longer buy a CRT display over the counter at any of the local stores - only flat screen. I know that may seem odd, but the huge inventories are or were exported to companies like Dell. When innovations occur the old stuff is quickly gone or sits around forever.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Sign In or Register to comment.