Jump to content
IGNORED

Joystick pinout question


AlwaysOnPlanetPatrol

Recommended Posts

I'm trying to build my own custom controller for Decathlon and Track&Field. Getting some arcade buttons to mimic the the Track&Field controller, except I want to build a cheat button that will do the left/right motion for me (enabled via a push button or switch, haven't decided yet).

 

I'm thinking of using a 555 timer (as suggested in the thread http://atariage.com/forums/topic/249361-schematic-for-a-rapid-fire-turbo-button/)and a potentiometer to regulate the rate.

 

Now, reading some of the posts and the Wiki page https://en.wikipedia.org/wiki/Atari_joystick_port, I have a couple of questions.

 

1. Before I start opening some joysticks to see how the voltages work, do pins 1-4 and 6 also continuously offer 5V like pin 7? I'm thinking I can just use a plain regular Atari joystick cable to get the 5V for the 555.

 

2. The Genesis controllers have pin 7 connected? Is that a good cable to harvest for my project? I have an original Genesis and aftermarket joysticks I had planned to modified for my 7800.

 

Thanks in advance for any advice/help.

Link to comment
Share on other sites

Thanks. I had a 9 pin extension cable (from an old modem or something), I stripped it but only found 7 cables and loose strands; missing the gray and white cables as per the RS232 info I found. Must have been a specialty cable. Guess I'm going on a trip to the electronics or computer store to get a proper one.

 

BTW, I noticed that the four directions and fire button complete the circuit on the joystick with ground; like here http://www.epanorama.net/documents/joystick/ataristick.html. If those pins go to the ground when pressed on the controller, how is the 2600 detecting the button presses?

Link to comment
Share on other sites

A simple 555 alone will not work because you need to create two opposing logic levels for left and right so you need a direct and inverted output. A ZVN4305A can be used to invert the output, connect S to 0V, D (your inverted output) to 5V via a 5K1 resistor and G to the 555 output.

You would also need a Double Pole, Double Throw (DPDT) switch to select between 555 and regular L/R joystick outputs.

 

The only sensible way to use a button without a lot of glue logic is to use a microcontroller instead of a 555, small 8 pin devices are the same size and cost as a 555. Something with an internal oscillator such as an 12F629 would work.

There are some free programing tools around, Arduino software (C although can use Assemble), MPLAB (C & Assembler), Great Cow BASIC. Also some programmers/development board with which to download you code to the device are quite cheap.

 

To use a microcontroller you would need to use 3 pins as inputs and 2 as outputs. Tie one input to 5V via a 5K1 (or internal pull up) resistor and to ground via your button. The other two inputs are connected to the joystick L & R.

 

Depending on the language syntax and pins used A BASIC program would look something like this...

 

Start:

'Button pressed Function

While PortB.3 = 0

PortB.4 = 1 'Left Joystick High

PortB.5 = 0 'Right Joystick Low (active)

DelayMs 100 'Wait 100 milliseconds (1 tenth of a second - can change this to suit)

PortB.4 = 0 'Left Joystick Low (active)
PortB.5 = 1 'Right Joystick High
DelayMs 100 'Wait 100 milliseconds (1 tenth of a second - can change this to suit but should be be same as above)

EndWhile

 

'Normal Joystick Function

PortB.4 = PortB.0 'Read and output joystick Left

PortB.5 = PortB.1 'Read and output joystick Right

Goto Start

  • Like 1
Link to comment
Share on other sites

Thank you very much Stephen, for the suggestion and the sample code, much appreciate you taking the time. The logic makes perfect sense to me. I never programmed a microcontroller, so I may take a crack at it. I looked at the specs; and what a wonderful coincidence, this chip also has 128 bytes of RAM.

 

I was also looking at trying this project in a couple of stages; using just doing one button and then trying the "sinking/sourcing" example as shown in http://www.electronics-tutorials.ws/waveforms/555_timer.html. That would hopefully allow me to trigger both buttons alternately. Your 12F629 suggestion will become my 3rd option, certainly has a lot more potential (especially if something with more inputs like the 16F630 and I can have an auto-fire option for some multi-function joystick).

 

 

Link to comment
Share on other sites

Thanks. I had a 9 pin extension cable (from an old modem or something), I stripped it but only found 7 cables and loose strands; missing the gray and white cables as per the RS232 info I found. Must have been a specialty cable. Guess I'm going on a trip to the electronics or computer store to get a proper one.

 

BTW, I noticed that the four directions and fire button complete the circuit on the joystick with ground; like here http://www.epanorama.net/documents/joystick/ataristick.html. If those pins go to the ground when pressed on the controller, how is the 2600 detecting the button presses?

If you can't find a cable otherwise, Console5.com has extension cables that provide all 9 conductors. Those conductors are pretty thin with very few strands of wire, but can be manipulated and soldered by ordinary means.

 

The relevant inputs to the 2600 are "pulled up" to 5v (a logic HI state) internally through resistors. So, when there's no connection to ground and the inputs look from the outside as if they're floating (unconnected), they're actually seen as logic "1"/HI. Grounding the input overrides the relatively weak pull up resistor and causes that grounded input to be read as a logic "0"/LO.

 

So, technically, instead of applying a 1 or 0 to those inputs, the joystick is applying nothing (open circuit aka high impedance aka Hi Z aka floating) to those inputs in the inactive position and is applying ground when the function of the joystick is activated.Whatever circuitry you build can actually apply either a logic 1 (+5v) or high impedance (no connection) in the inactive state.

 

Having said all of that, in a practical sense, there's nothing whatsoever wrong with applying true logic HI/LO signals to the inputs with the PIC microcontroller or any other device.

Link to comment
Share on other sites

If you can't find a cable otherwise, Console5.com has extension cables that provide all 9 conductors. Those conductors are pretty thin with very few strands of wire, but can be manipulated and soldered by ordinary means.

 

The relevant inputs to the 2600 are "pulled up" to 5v (a logic HI state) internally through resistors. So, when there's no connection to ground and the inputs look from the outside as if they're floating (unconnected), they're actually seen as logic "1". Grounding the input overrides the relatively weak pull up resistor and causes that grounded input to be read as a logic 0.

 

So, technically, instead of applying a 1 or 0 to those inputs, the joystick is applying nothing (open circuit aka high impedance aka Hi Z aka floating) to those inputs in the inactive position and is applying ground when the function of the joystick is activated.Whatever circuitry you build can actually apply either a logic 1 (+5v) or high impedance (no connection) in the inactive state.

 

Having said all of that, in a practical sense, there's nothing whatsoever wrong with applying true logic HI/LO signals to the inputs with the PIC microcontroller or any other device.

 

Thank you for the explanation; that clears it in my head.

 

And thanks for the cable info; those are great prices. Shipping cost to Canada is the problem unfortunately. They have a bunch of other items, so will see how the RS232 fares as a starter.

Link to comment
Share on other sites

The problem I've found with typical communication cables is that they don't plug in to the console as reliably as a joystick cable. If I remember correctly, they won't plug into my "Heavy 6'er" without modification.

 

Yes, agreed, that's my concern as well using the metal plug with the comm cables rather than a proper Atari one. The comm cable I tried yesterday fits in my 7800 and ideally I will get a proper cable.

Link to comment
Share on other sites

 

I was also looking at trying this project in a couple of stages; using just doing one button and then trying the "sinking/sourcing" example as shown in http://www.electronics-tutorials.ws/waveforms/555_timer.html. That would hopefully allow me to trigger both buttons alternately.

I am not sure what you were thinking off but I cannot see any way that could work or any method of using a 555 timer alone to get the two anti phase outputs required to emulate the required Left/Right joystick movement hence my previous suggestions although I meant to say a ZVN4306A, ZVN4305A was a typo.

Link to comment
Share on other sites

I am not sure what you were thinking off but I cannot see any way that could work or any method of using a 555 timer alone to get the two anti phase outputs required to emulate the required Left/Right joystick movement hence my previous suggestions although I meant to say a ZVN4306A, ZVN4305A was a typo.

 

Yes, I'm not 100% as I have not tried this myself. I've seen some examples for alternating lights using the 555, and the also the example in the tutorial linked above. I've been meaning to sketch it out and get the parts but haven't had a good hour of peace and quiet for the last couple of days.

Link to comment
Share on other sites

You can alternate two LED Flashing LED's (1 on, 1 on off) directly from the output of a 555 just as per the circuit in the link but that is not the same thing as driving the 2600 joystick inputs because the LED circuit relies on sinking one & sourcing the other.

 

The problem is that will not work on the 2600 because all the joystick inputs are pulled high inside an IC and thus can only be connected to and work in the sink configuration, consequently I cannot see how it would be physically or electrically possible to wire both the Left & Right joystick inputs to the 555 output and have them operate in a sink/source (a.k.a. Push/Pull) configuration.

For a push/pull configuration to work either L or R would of had to be internally pulled low (to 0V) with the other pulled high (to 5V).

Link to comment
Share on other sites

couple cents

 

1) sega genesis controller extension cords provide all 9 pins, and are the correct fit, so maybe you can find one locally for cheap

 

2) this will work on 5 volts, but I dont know if it provides the required result, but its fun to play with (ps you can use just about any npn transistors)

 

UjOyx.jpg

 

when the output on the left is high, the output on the right is low and vice versa, simple oscillator people like to use in model train setup's (it "wig-wag" the lights on crossings heh) among other things

Edited by Osgeld
  • Like 2
Link to comment
Share on other sites

If you want to use a 555 timer you can still do it but you will also have to add a transistor. You will tie the output to left direction, and also tie the output to a base of a NPN transistor(through a resistor), take the emitter to ground, and tie the collector to right input. Whenever the output is low it will trigger the left input and when it is high it will trigger the right input via the transistor.

 

EDIT:

I just read above someone also already mentioned that pretty much inverting the output using a different method but yeah either way would work.

Edited by SignGuy81
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...