Interfacing Atari 2600 style Joystick
stamped
Posts: 68
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?
Post Edited (stamped) : 1/21/2008 8:35:27 AM GMT
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
Steven
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian
uController.com - home of SpinStudio
PropNIC - Add ethernet ability to your Propeller!
SD card Adapter
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!)
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!)
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..
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!