Shop OBEX P1 Docs P2 Docs Learn Events
Interfacing Atari 2600 style Joystick — Parallax Forums

Interfacing Atari 2600 style Joystick

stampedstamped Posts: 68
edited 2008-01-22 17:34 in Propeller 1
I am working on interfacing an Atari 2600 style joystick. I have been able to read values from the joystick. It basically fires 5v per direction pin (see http://pinouts.ru/Inputs/JoystickAtari2600_pinout.shtml·for the Atari pin-out).

I have put a 10k resistor between each of the joystick pins and the Prop pins. I have also got pin 7 direct to +5v and pin 8 direct·to ground (the same as the prop ground). I am however witnessing some strange behavior. Sometimes I am getting logical highs for Left when I push Forward. Then followed by the Forward etc. Sometimes if I press·forward, I will get 5 forwards in a·row.·This is strange. It is almost like it is getting some interference due to my interfacing. Does anyone know of a simple Atari 2600 joystick interface for the Prop? Anything obvious that I am doing wrong with my interfacing?

dira[noparse][[/noparse]1..4] := %0
 
repeat
  waitcnt(clkfreq + cnt)
 
  if(ina[noparse][[/noparse]1] == 1)
    debug.cprintf(string("Forward"), 0, false)
  elseif(ina[noparse][[/noparse]2] == 1)
    debug.cprintf(string("Reverse"), 0, false)
  elseif(ina[noparse][[/noparse]3] == 1)
    debug.cprintf(string("Left"), 0, false)
  elseif(ina[noparse][[/noparse]4] == 1)
    debug.cprintf(string("Right"), 0, false)




Post Edited (stamped) : 1/21/2008 8:35:27 AM GMT

Comments

  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-01-21 09:37
    From the page you linked to it appears that pin 8 does nothing. Try putting pullup or pulldown resistors on all the output pins of your joystick. The 5 fowards in a row is probably just the contacts bouncing. Someone smarter will have some de-bounce code that will help with that.

    Steven
  • parts-man73parts-man73 Posts: 830
    edited 2008-01-21 13:32
    stamped said...
    Does anyone know of a simple Atari 2600 joystick interface for the Prop?

    have you seen my PropJoy at uController.com ?

    as for help with your circuit, I'd have to see the circuit that you are using to connect. The joystick contains 5 switches, so it's just like interfacing 5 regular switches. You'll need pull ups (or downs) and some type of debouncing, either hardware or software.

    The Propjoy uses a shift register, it takes a "snapshot" of the switch values, and you then shift the data out of the shift register to read the values of the switches. The resulting output is a 8 bit value, reading individual bits will reveal which switches are depressed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Brian

    uController.com - home of SpinStudio

    PropNIC - Add ethernet ability to your Propeller!

    SD card Adapter
  • BaggersBaggers Posts: 3,019
    edited 2008-01-21 14:27
    stamped, The best think about parts-man73's PropJoy is that it's compatible with my games [noparse]:D[/noparse] and easy to read, also, most hydra games, can easily be ported to use this controller, and it only uses 3 pins ( or just 4 for two joypads ) [noparse]:D[/noparse]
  • parts-man73parts-man73 Posts: 830
    edited 2008-01-21 14:41
    Forgot to mention... There are tutorials on uController.com that explain how any of the SpinStudio modules can also be used with a Proto Board or a solderless breadboard.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Brian

    uController.com - home of SpinStudio

    PropNIC - Add ethernet ability to your Propeller!

    SD card Adapter
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-01-21 14:56
    I did an Atari interface design that plugged into the VGA port of the Demoboard or expanded Protoboard.
    There's details in the Cookbook, and in the Object Exchange.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Getting started with the Protoboard? - Propeller Cookbook
    Got an SD card? - PropDOS
    A Living Propeller FAQ - The Propeller Wiki
    (Got the Knowledge? Got a Moment? Add something today!)

  • deSilvadeSilva Posts: 2,967
    edited 2008-01-21 15:10
    As others have already noted, the ATARI joystick is nothing but five switches, open - thus needing a pull-up! - or closed to what is called GND, but can be anything you like . There is no kind of any "electronic" or whatever in it.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-01-21 15:21
    Page 12 of the Cookbook (below) has the simple schematic for a switch with debounce.
    Just duplicate it 5 times and you're in business.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Getting started with the Protoboard? - Propeller Cookbook
    Got an SD card? - PropDOS
    A Living Propeller FAQ - The Propeller Wiki
    (Got the Knowledge? Got a Moment? Add something today!)

  • stampedstamped Posts: 68
    edited 2008-01-21 23:13
    Thanks everyone for all the notes and pointers.

    OBC; thanks for the tip in the Cookbook. I will give it a shot and post the results.

    With regards to Brian's UController parts; I have already bought a heap of parts (SD Card, Ethernet, Servo Controller, SpinStudio, LCD board etc) from Brian but have not had a chance to solder them yet. I just noticed the joystick part a few days ago. I do not have time to wait on the shipping, so I will try to do a temporary solution using the de-bounce..
  • stampedstamped Posts: 68
    edited 2008-01-22 11:47
    I realize my mistake (thanks to the comments). No pulling-up, so the lines were floating. I have now pulled them up. I have Left, Right and Reverse working reliably. Forward however is not working as expected. Something strange is going on, as when I have the multi-meter probes on it, it functions fine. When I remove them it does not function. It is almost like it has a grounding or interference issue. It is sitting constant pulled-up at 4v. The other outputs are sitting from 3.8v up to 4v (forward is @4).

    Note; I have ordered one of Brians PropJoy's (excited about 4 pins for two sticks - authentic tank control!). That said, I would like to work out why this circuit is not working to plan. Any suggestions are appreciated!
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-22 17:34
    Just screw the thing open and have a look into it.. It's not only easy to open but also easy to re-assemble again smile.gif
Sign In or Register to comment.