Shop OBEX P1 Docs P2 Docs Learn Events
Reading 0-100k PC joystick resistance. Best route ADC? — Parallax Forums

Reading 0-100k PC joystick resistance. Best route ADC?

Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
edited 2011-02-12 21:51 in Propeller 1
I was motivated by the recent Logitech joystick hacking to purchase several PC joysticks from the local Goodwill today (I spent less than $10 for three) In the idea of creating a simple circuit I can stick on the GGPP board with a salvaged 25pin connector from an old sound card.

The standard PC joystick uses two 0-100k resistors. I'm guessing it's time to dig out an ADC chip as if memory serves the RCtime circuit is really intended for 0-10k.

(A MIGS driver for a PC joystick could be in the works.)

Any wizards want to confirm of suggest alternatives?

OBC

Comments

  • JonnyMacJonnyMac Posts: 9,208
    edited 2011-02-03 15:54
    If you have access to the pot you can do what you like, and the MCP320x series is really easy to use and gives you enough resolution to let you chuck the noise bits.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-02-03 16:00
    @Jon,

    You've confirmed my thoughts on this.. I think I'll go with the MCP3208 so that the project will dovetail with the existing materials that Nick posted recently. http://www.gadgetgangster.com/tutorials/382

    OBC
  • JonnyMacJonnyMac Posts: 9,208
    edited 2011-02-03 16:03
    I just used it in a camera pan/tilt controller that I coded for a friend. It's quite easy to use in Spin or PASM.

    One comment on Nick's post: I put a 2.2K resistor between DO and DI (the Propeller is connected to DI); this protects the Propeller IO pin if there's a programming error, and limits the current into the pin when running the MCP320x at 5v.

    This might be useful:
    -- http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp8.pdf
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-02-03 16:09
    Thanks Jon!
  • Nick McClickNick McClick Posts: 1,003
    edited 2011-02-03 16:31
    @Jon - Good catch, I'll clean that up.
  • pjvpjv Posts: 1,903
    edited 2011-02-03 16:40
    Hi OBC;

    Not sure what a GGPP board is..... but, in case it has a propeller on it, or the pots are going to be interfaced to a propeller, then is there a reason why you would not use the Sigma Delta ADC concept to convert the pot settings to a digital number? The hardware for that costs 5 cents; two resistors plus one capacitor, and the code to effect that function is less than the code to interface some external ADC. Seems like the best solution to me.

    Cheers,

    Peter (pjv)
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-02-03 17:38
    I bought this on eBay - A Classic controller Pro for < $9 inc shipping. It has an I2C interface and 2 joysticks etc. I intend to interface a series of Wii controllers to the prop :)
  • Keith YoungKeith Young Posts: 569
    edited 2011-02-03 18:37
    My project uses just such a chip. The 4 Ch sold on Parallax will cover this. I will update the documentation of my object to reflect that the chip is needed.

    Sorry if my lack of documentation caused any confusion, it's my first OBEX release.
  • jeff-ojeff-o Posts: 181
    edited 2011-02-03 18:52
    @Jon,

    You've confirmed my thoughts on this.. I think I'll go with the MCP3208 so that the project will dovetail with the existing materials that Nick posted recently. http://www.gadgetgangster.com/tutorials/382

    OBC

    I've successfully used a few ADCs from that line (3202, 3208) and they work fine.
  • Nick McClickNick McClick Posts: 1,003
    edited 2011-02-03 19:24
    @cluso - off topic, but let me know how the wii classic controller works. I wonder if they all have the same i2c slave address.
  • jdoleckijdolecki Posts: 726
    edited 2011-02-03 20:02
    You found my secret source of electronic junk!

    I too got several joysticks fron GoodWill and the salvation army stores.

    Also look in the book section

    I just got a Z-80 programming textbook for a dollar.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-02-12 16:59
    Update:

    So I've got this wonderful little ADC interface created using a recycled 15pin connector from an old soundcard. (This works extremely well because you only need the top row of pins on the connector, so the weird offset of the second row isn't a problem)

    I'm reading right, left, up and down no problem.. But rediscovered something..

    You get what you pay for...

    Those cheap, plastic, PC joysticks from Goodwill belong there. :)

    Time to get an old "Thrustmaster" off ebay and do this right...

    OBC
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-02-12 19:13
    Nick: It has an I2C interface but dont know the address. Unfortunately I believe we cannot use 2 on the same I2C bus. I also have a Wii Motion Plus (gyro) and Wii Nunchuck to interface too.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-02-12 21:51
    Thanks, but this project is more about the ADC than the joystick itself. For the moment I've boxed the joysticks and moved on. The end result should be an easily understandable lesson on ADC for the beginner.

    OBC
Sign In or Register to comment.