PDA

View Full Version : Interfacing Atari 2600 style Joystick



stamped
01-21-2008, 04:26 PM
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[1..4] := %0

repeat
waitcnt(clkfreq + cnt)

if(ina[1] == 1)
debug.cprintf(string("Forward"), 0, false)
elseif(ina[2] == 1)
debug.cprintf(string("Reverse"), 0, false)
elseif(ina[3] == 1)
debug.cprintf(string("Left"), 0, false)
elseif(ina[4] == 1)
debug.cprintf(string("Right"), 0, false)




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

stevenmess2004
01-21-2008, 05:37 PM
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-man73
01-21-2008, 09:32 PM
stamped said...
Does anyone know of a simple Atari 2600 joystick interface for the Prop?


have you seen my PropJoy at uController.com (http://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 (http://uController.com) - home of SpinStudio

PropNIC (http://uController.com) - Add ethernet ability to your Propeller!

SD card Adapter (http://uController.com)

Baggers
01-21-2008, 10:27 PM
stamped, The best think about parts-man73's PropJoy is that it's compatible with my games :D 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 ) :D

parts-man73
01-21-2008, 10:41 PM
Forgot to mention... There are tutorials on uController.com (http://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 (http://uController.com) - home of SpinStudio

PropNIC (http://uController.com) - Add ethernet ability to your Propeller!

SD card Adapter (http://uController.com)

Oldbitcollector (Jeff)
01-21-2008, 10:56 PM
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 (http://ucontroller.com/Propeller%20Protoboard%20Designs%20for%20the%20Beg inner.pdf)
Got an SD card? - PropDOS (http://www.orrtech.net/propdos/)
A Living Propeller FAQ - The Propeller Wiki (http://propeller.wikispaces.com/)
(Got the Knowledge? Got a Moment? Add something today!)

deSilva
01-21-2008, 11:10 PM
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)
01-21-2008, 11:21 PM
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 (http://ucontroller.com/Propeller%20Protoboard%20Designs%20for%20the%20Beg inner.pdf)
Got an SD card? - PropDOS (http://www.orrtech.net/propdos/)
A Living Propeller FAQ - The Propeller Wiki (http://propeller.wikispaces.com/)
(Got the Knowledge? Got a Moment? Add something today!)

stamped
01-22-2008, 07:13 AM
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..

stamped
01-22-2008, 07:47 PM
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!

deSilva
01-23-2008, 01:34 AM
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 http://forums.parallax.com/images/smilies/smile.gif