Jump to content
IGNORED

Joystick multiplexer help


gauauu

Recommended Posts

38 minutes ago, ChildOfCv said:

To be clear:  The Genesis controller gets its power from pin 5.  If you have nothing hooked to that pin, then the Genesis controller will be running on borrowed power from its input pins and it's a crap shoot whether it works or not.  The Genesis controller uses pin 7 to multiplex the buttons and directions.  If that's the only thing that gets power, the multiplexer chip "may" work, but don't count on it.

Okay, that makes sense.  Silly question: without the QT, if I hook a Genesis directly to the Atari, how does it get power to pin 5?  Meaning, how does a Genesis controller work reliably at all if power is just connected to pin 7?  I would assume pin 5 from the Atari is connected to pin 5 of the Genesis controller and that isn't VCC, right?  It's the paddle input so it would always be low unless dump ports was active, right?  

38 minutes ago, ChildOfCv said:

Atari has the dumper transistors on pins 5 and 9 of both controllers.  The Quadtari has a pull-up resistor on pin 5 so that it can act as an input selector.  But there's no reason to even pass that on to the joysticks, so it is apparently unconnected.

Actually the QuadTari has a pull up resistor on pin 9; pin 5 isn't connected from the Atari at all.  It is correct that pin 5 and pin 9 are not passed on to the joysticks at all.

38 minutes ago, ChildOfCv said:

Perhaps you could have a selector switch for each joystick plug for "genesis/other".  In Genesis mode, pin 5 is also powered and in Other mode, only pin 7 is.

 

Or create a small pass-through plug adaptor that makes that cross-connection.

I just tested with pin 5 of the joystick connected to pin 7 and as you promised it does work without issue. :thumbsup:  Question:  is there a reason why I can't just have pin 7 and pin 5 of the joystick hooked up to pin 7 (vcc) of the Atari all the time?  I tested with pin 5 and 7 hooked up to vcc with all the joysticks and it works in all cases.   If I only have pin 5 connected, the Genesis arcade stick works but the Hyperkin ranger does not (my guess is that the HR gets power on pin 7 since it's designed to be an Atari controller).  If I have pin 7 connected, as we know the Genesis is inconsistent but the Hyperkin works without issue.  If both are connected, all joysticks work without issue.  Is there any harm in having them both connected?  I would assume for regular Atari joysticks where pin 5 and 9 aren't even wired up there is no risk.  The Hyperkin probably doesn't even look at pin 5 or pin 9 in joystick mode so that's probably fine.  I'm not sure how the Colecovision controller works but that seemed to work fine with both hooked up.  The Genesis as you said uses pin 5 for vcc and pin 7 to multiplex; if they're both hooked up to vcc then only button B will only be active which isn't a problem since we don't read the other joystick anyway.

 

A switch would work too but I'm not sure if it's needed; we're trying to keep the design as simple as possible. :cool:  

 

Thanks again for the suggestions!

John

 

Link to comment
Share on other sites

2 minutes ago, johnnywc said:

Okay, that makes sense.  Silly question: without the QT, if I hook a Genesis directly to the Atari, how does it get power to pin 5?  Meaning, how does a Genesis controller work reliably at all if power is just connected to pin 7?  I would assume pin 5 from the Atari is connected to pin 5 of the Genesis controller and that isn't VCC, right?  It's the paddle input so it would always be low unless dump ports was active, right?

It's not getting power from pin 5, but from the other inputs like pin 7.  Digital ICs can get power that way, but some parts of the circuit will not be reliable.  But it can be demonstrated with a microcontroller programmed to blink an LED that you can make it work without connecting VCC.  It's just not as stable or as strong at driving its outputs because its internal power rail is only whatever it can steal from the other pins.

 

7 minutes ago, johnnywc said:

If I only have pin 5 connected, the Genesis arcade stick works but the Hyperkin ranger does not (my guess is that the HR gets power on pin 7 since it's designed to be an Atari controller).

The Genesis also needs something connected to pin 7 so that it has the right selection on its multiplexer.  So you'd definitely keep pin 7 powered.

 

I was hesitant to suggest ALWAYS powering both pins 5 and 7 because I was afraid that at least one would fail that way.  I guess CV is okay because you want pins 5 and 8 to be opposites.  8 is ground, so if 5 is powered then you're okay there.

 

Paddle controllers have a resistor between pin 7 and pin 5, so they would effectively do nothing, and at least nothing destructive either.

 

I don't know all the joysticks that you want compatibility with, but maybe always also powering pin 5 is not a problem.

Link to comment
Share on other sites

2 hours ago, ChildOfCv said:

It's not getting power from pin 5, but from the other inputs like pin 7.  Digital ICs can get power that way, but some parts of the circuit will not be reliable.  But it can be demonstrated with a microcontroller programmed to blink an LED that you can make it work without connecting VCC.  It's just not as stable or as strong at driving its outputs because its internal power rail is only whatever it can steal from the other pins.

Okay that makes sense.  

2 hours ago, ChildOfCv said:

The Genesis also needs something connected to pin 7 so that it has the right selection on its multiplexer.  So you'd definitely keep pin 7 powered.

Gotcha.

2 hours ago, ChildOfCv said:

I was hesitant to suggest ALWAYS powering both pins 5 and 7 because I was afraid that at least one would fail that way.  I guess CV is okay because you want pins 5 and 8 to be opposites.  8 is ground, so if 5 is powered then you're okay there.

 

Paddle controllers have a resistor between pin 7 and pin 5, so they would effectively do nothing, and at least nothing destructive either.

 

I don't know all the joysticks that you want compatibility with, but maybe always also powering pin 5 is not a problem.

Okay, thanks for the suggestions!  I'm not sure how we'll go with this; maybe we'll add a switch for pin 5 for Genesis 100% compatibility, although the gamepads seem to work without anything hooked up to pin 5, most likely because they don't have the auto-fire mechanism and LEDs that the Arcade Stick has. 

 

Thanks again! 

 

John

 

Link to comment
Share on other sites

So I think we're all set; we're going to wire up vcc to pin 5 and 7 which works for all cases.

 

Now that we're doing that, the Genesis controllers work reliably with lower pull-up resistor values on the select line.  Previously, they did not work with 10k or 4.7k ohms (we went with 100k which worked for all).  Now that we have vcc going to the pins, all joysticks (Genesis gamepad and arcade stick included) work with 10k and 4.7k resistors.  Is it worth using a lower value resistor for the select line?  What is the benefit?  Is there any risk?  Should we try lower values?  I think you mentioned that lower was better, perhaps because the responsiveness is better?

 

Thanks,

John

Link to comment
Share on other sites

Yeah I think 10K would be enough.

 

The 2600s had a 1800-ohm resistor on each of the paddle inputs which protects the TIA from shorts.  The 2600A, sadly did away with them and apparently depends on the paddle controller to never drop resistance below a few hundred ohms on any input.

 

But that does reduce the response of the joystick switching a little, so using a smaller select pull-up resistor should help with that.

Link to comment
Share on other sites

20 hours ago, ChildOfCv said:

Yeah I think 10K would be enough.

 

The 2600s had a 1800-ohm resistor on each of the paddle inputs which protects the TIA from shorts.  The 2600A, sadly did away with them and apparently depends on the paddle controller to never drop resistance below a few hundred ohms on any input.

 

But that does reduce the response of the joystick switching a little, so using a smaller select pull-up resistor should help with that.

Great thanks for the suggestion!  We're going to go with 10K. :thumbsup:  

1 hour ago, Danjovic said:

I should be out of my mind when I missed both the Inhibt and the mux Select issues ? !

But I am glad to hear that the circuit is working.

 

:P  No worries - we (well, ChildOfCV) figured it out pretty quick! :D  Thanks for the design, it works very well and no interference to boot! :thumbsup:  

  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...

Okay, we're about to go production (Nathan T is researching enclosures, cables, etc).  I went into the 'lab' last night to test Zoo Keeper QuadTari support and I hit an issue on my 7800.

 

Back store:  My house was hit by lightning a few days ago and it knocked out my pool filter, timer, garage door, etc.  Yesterday when I went to test on my modded 2600, I found that it did not work anymore (power goes to the system but when you turn it on it acts as if there is no cartridge in it, but with weird graphics and sounds).  I tested with another power supply, different carts, TV, etc. so I believe the 2600 itself is fried somewhat (I sent it out to repair).

 

My 7800 seems to have survived (games play fine, controllers work without the QT, etc), but I am getting a weird result with the new design of the QuadTari (which worked without issue prior to The Storm):

 

  • The QuadTari is detected by QuadTari compatible games.  = GOOD
  • Movement (up/down/left/right) works for QT games = GOOD
  • Buttons do NOT work. ?  = BAD
  • Troubleshooting:
    • My QT was hooked up to another system that was plugged in at the time of the strike so I swapped in new components to the QT (new multiplexers and resistor).  Same result.
    • I checked all wires, re-wired the entire circuit.  Same result.
    • I tried the old QT design from last year which is functionally compatible but uses 245's and pull up resistors on the inputs and output.  Works fine (including the buttons)
    • I connected all 5 inputs directly to the Atari (no multiplexers) and the button works.
    • I hooked the button up through a multiplexer and forced the select line to either VCC or Ground.  In each case, the button did not work.
      • For this, I used a multimeter and measured the voltages at the two mux inputs and the output, and confirmed that one input was high constant (hooked up to Vcc) and the other would be 5V when the button was not pressed and 0 when the button was pressed.
      • I measured the output of the mux and no matter what the button state is, the output is always high.  I further confirmed this by hooking up ground to both mux inputs, and the output of the mux is still high.
      • I measured the output again, but this time I disconnected the output to the Atari first.  In this case, the reading is correct:  it goes low when I press the button and stays high when the button is not pressed
      • Based on these results, it seems that the output of the mux is being pulled high by the Atari on pin 6 no matter what the output of the mux is.  I measured it and it stays at a constant ~5V.  
    • I reconnected up the entire QT and test again on the 7800, as expected same result:  all directions work, button does not.
    • My last test was to dig out another Atari out of storage that hasn't been touched by me ;) and hook up the QuadTari, and the buttons work fine. :|  

 

EDIT: I added in a pull up resistor between the Atari and pin 6 (button) output from the mux and that didn't help.  Come to think of it, it shouldn't help because the problem is that it's not registering a logical low (not high).  Also, I did some more measurements:

 

  • When a switch is open at the joystick, the voltage slowly moves from 5.2 volts down to 3.6 volts, and then back up.  I assume this is because it's a "floating" high?  I added a 1M pull up resistor on the button input to test and the voltage now fluctuates between 5.5 volts and 5.1 volts.  Is a pull up resistor recommended or required on the joystick inputs?  They all seem to work without it, but figured I'd ask.
  • As expected, when you close a switch, the measurement at the joystick goes down to 0 volts.
  • When one button is pressed, the measurement at pin 6 (button) on the working Atari goes down to 2.6 volts.  I think this is expected for QT games since with the switching the measurement would be 0 for 1/2 the time and 5.2 volts.  To confirm, I pressed both buttons and as expected the voltage at the Atari for pin 6 goes down to 0 volts.
  • On the 7800, the measurement at pin 6 on the Atari when the buttons aren't pressed is 5.2 volts, but it only goes down to 5.0 volts when 1 button is pressed and 4.9 volts when both are pressed (which explains why the buttons are registering).  Is there something in the 7800 that is pulling that value high?  Again, the button works fine when you plug in a joystick directly or use the old QT design with the 245 buffers.

 

 

Any ideas?  Is it possible that the 7800 got damaged somehow so that it's affecting how pin 6 is read or plays with the mux?  The strange thing is that it worked on the 4-switch 2600 fine.  Also, the old QT with pull up resistors on the input and output works fine on both systems.  It also works fine if I hook up a joystick directly.   I am going to add pull up resistors on the output and see if that fixes the problem, but my main concern is that this worked before and not now so I'm trying to figure out what has changed (or could have changed).

 

Any help is appreciated!

 

Thanks,

John

 

 

Edited by johnnywc
Link to comment
Share on other sites

I just pulled up the schematics.

 

On the 2600, pin 6 on each port has a 10K pull-up to +5V.  On the 7800, pin 6 on each port has a transistor pulling it up.  Each transistor is set up to limit to around 0.1mA so it won't fry the transistor to push the fire button.  But that does give you a problem if you can't get a good connection to ground.

 

When playing a 7800 game, it apparently turns off those transistors.  You can also force those transistors off using port B of the 6532.  Bits 2 and 4 individually turn off the pull-ups.

 

Are you sure it was working on the 7800 before?  Or maybe you were testing it with a 7800 game?

 

Anyway, the analog multiplexer does have some resistance, so it is possible that it can't pull the transistor-based pull-up down to 0V. That could cause trouble.

Edited by ChildOfCv
Link to comment
Share on other sites

4 hours ago, ChildOfCv said:

I just pulled up the schematics.

 

On the 2600, pin 6 on each port has a 10K pull-up to +5V.  On the 7800, pin 6 on each port has a transistor pulling it up.  Each transistor is set up to limit to around 0.1mA so it won't fry the transistor to push the fire button.  But that does give you a problem if you can't get a good connection to ground.

 

When playing a 7800 game, it apparently turns off those transistors.  You can also force those transistors off using port B of the 6532.  Bits 2 and 4 individually turn off the pull-ups.

Thanks for the info!  I figured there was something different between the 2600 and 7800 that was causing the issue.

4 hours ago, ChildOfCv said:

Are you sure it was working on the 7800 before?  Or maybe you were testing it with a 7800 game?

I'm 99.9% sure it was working on a 7800 before.  My test environment has an un-modded 2600 hooked up to a CRT, an S-video modded 2600 that's hooked up to a CRT and an AV-modded 7800 hooked up to my 1702.  I distinctly remember doing tests on all 3, most notably the 7800 because the 1702 is near my computer where I was modifying the test program to add in the color/bw and difficulty switch options. :)  I don't have 7800 games that aren't in storage so I'm 100% sure the tests were with 2600 cartridges (the Harmony cart, my test program and the original 2K Basketball game, to be exact).  I know the button was working or I would not have been able to select the test program from the Harmony cart.

4 hours ago, ChildOfCv said:

Anyway, the analog multiplexer does have some resistance, so it is possible that it can't pull the transistor-based pull-up down to 0V. That could cause trouble.

Hmm, that doesn't sound good. :(  Any electrical issue that could have caused it to go from working to non-working (ie. a transistor/capacitor/resistor in the 7800 got fried with the lightning issue I had)?  Is there anything we can put between the mux and the Atari that can assist in pulling the transistor-based pull up to 0V?

 

 

Link to comment
Share on other sites

7 hours ago, johnnywc said:

Hmm, that doesn't sound good. :(  Any electrical issue that could have caused it to go from working to non-working (ie. a transistor/capacitor/resistor in the 7800 got fried with the lightning issue I had)?  Is there anything we can put between the mux and the Atari that can assist in pulling the transistor-based pull up to 0V?

For starters, try programming those two bits on port B to switch off the transistors.  Let's see if that at least makes it easier to pull the voltage down on the buttons.

Link to comment
Share on other sites

16 minutes ago, ChildOfCv said:

For starters, try programming those two bits on port B to switch off the transistors.  Let's see if that at least makes it easier to pull the voltage down on the buttons.

Okay, I'm not exactly sure what that means.  SWCHB is input only so I don't think you mean that, unless it can be configured for output on a 7800?  I checked and bits 2 and 4 are unused (0-based) so maybe that's what you mean?  Sorry for the confusion!   

Link to comment
Share on other sites

9 hours ago, johnnywc said:

SWCHB is input only so I don't think you mean that, unless it can be configured for output on a 7800?

Despite what the "Stella programmer's Guide" says, Port B is fully configurable as output.
The value read from Port B will always be the one written to it when set as output (On port A, a controller or other device connected to the port can override the value), so in theory you could use SWCHB as an extra byte of memory. The problem is that the switches short the pins to ground in one of the two positions, and I read contrasting opinions on whether the 6532 can handle this safely or not.
 Anyway, it is surely safe to set the 3 unused bits of Port B as output (as they're not connected to anything in a 2600), so they can be used as extra storage. IIRC "Combat" uses one of the bits.

Edited by alex_79
Link to comment
Share on other sites

8 hours ago, alex_79 said:

Despite what the "Stella programmer's Guide" says, Port B is fully configurable as output.
The value read from Port B will always be the one written to it when set as output (On port A, a controller or other device connected to the port can override the value), so in theory you could use SWCHB as an extra byte of memory. The problem is that the switches short the pins to ground in one of the two positions, and I read contrasting opinions on whether the 6532 can handle this safely or not.
 Anyway, it is surely safe to set the 3 unused bits of Port B as output (as they're not connected to anything in a 2600), so they can be used as extra storage. IIRC "Combat" uses one of the bits.

Okay, that makes sense, and I do recall a game using the bits as RAM, although I didn't realize it was the *first* 2600 game! ? 

18 hours ago, RevEng said:

Yep, those are the two bits. The details are here.

Great thx for the link.. unfortunately my Norton antivirus says it's a 'bad site' and I can't open it. ?  

8 hours ago, ChildOfCv said:

Yeah the guide doesn't have a detailed instruction section about CTLSWB, but that register lets you individually control the direction of each bit on port B, as shown in the example code.

 

Okay, I put this code in the beginning of my test program to disable the transistors:

 

lda #%00010100	; bits 4 and 2 (0 based)
sta SWBCNT      ; enable for output
sta SWCHB       ; disable transitors

Unfortunately, this didn't seem to make any difference with the buttons working on the 7800. :(  I only had time for a quick test but I will measure the voltage on pin 6 to see if it goes any lower when the button(s) are pressed vs. the readings I got with the transistors enabled.

 

Link to comment
Share on other sites

47 minutes ago, johnnywc said:

Great thx for the link.. unfortunately my Norton antivirus says it's a 'bad site' and I can't open it. ?  

Yeah, it's my site. The reason Norton is complaining is because it hosts binaries that were built using open source tools, and AV vendors aren't technically savvy enough to tell the difference between "hello world" and a virus.

Link to comment
Share on other sites

4 hours ago, johnnywc said:

Unfortunately, this didn't seem to make any difference with the buttons working on the 7800. :(  I only had time for a quick test but I will measure the voltage on pin 6 to see if it goes any lower when the button(s) are pressed vs. the readings I got with the transistors enabled.

Yeah it should be useful to see the voltages with port B in either state, and see if it makes a difference.  If not, then it's possible that the transistors were affected too.

Link to comment
Share on other sites

4 hours ago, RevEng said:

Yeah, it's my site. The reason Norton is complaining is because it hosts binaries that were built using open source tools, and AV vendors aren't technically savvy enough to tell the difference between "hello world" and a virus.

No worries, I was able to bring it up on my phone. :D 

35 minutes ago, ChildOfCv said:

Yeah it should be useful to see the voltages with port B in either state, and see if it makes a difference.  If not, then it's possible that the transistors were affected too.

Okay, I did some measurements of pin 6 on the Atari and they are the same with my old multi-tap app that doesn't set the bits of SWCHB and the new app that sets bits 2 and 4 high for SWCHB:

 

No buttons pressed: ~5.40 V

one button pressed: ~5.00 V

both buttons pressed: ~4.63 V

 

I think I may be setting the bits wrong; should they be set to '0' and not '1'?  The reason I ask is that I'm displaying the value of SWCHB in both applications and for both they all display 00111111 (the two 0's are for the difficulty switches that are in the B position), so it seems that bits 2 and 4 default to 1 even if you don't do a write to SWCHB.  

 

I did measurements for pin 6 at the Atari on the working 2600 and they are the expected values of 5.52V (no buttons pressed), 2.46V (1 button pressed) and 0.15V (both buttons pressed).

 

I'll modify the program to write 0's into bit 2 and 4 and see if that makes a difference.

 

Thanks!

John

 

PS Regarding the other question about the "floating" voltage I'm getting measuring the inputs at the joystick that I mentioned above.  It looks like it fluctuates slowly between 5.2V and 3.6V when the switch is open.  Is this okay?  Do you recommend a pull-up resistor on the joystick inputs?  I added a 1M (I'm sure smaller values would suffice too) pull-up resistor network (we had these in the previous designs) and the voltage now fluctuates between 5.5V and 5.1, but I'm not sure if it's needed.  Thanks!

Edited by johnnywc
Link to comment
Share on other sites

6 hours ago, johnnywc said:

Update: I modified my test program to set bits 2 and 4 of SWCHB to '0' (as it seems that they default to 1) and the voltage measurements for pin 6 on the Atari are the same with no buttons/1 button/2 buttons pressed as the bits being set high. ? 

Then there may be some damage to the system.  Maybe you could locate the transistors and test the voltages at the base, with the output bits high vs low.  Q5 and Q6 are the two that pull the voltage up.  Q8 is the "master" which is switched on or off depending on TIA or MARIA mode.  The base is the middle pin.  Then with the flat side on the west, the output pin would be on the south.

Edited by ChildOfCv
Link to comment
Share on other sites

1 hour ago, ChildOfCv said:

Then there may be some damage to the system.  Maybe you could locate the transistors and test the voltages at the base, with the output bits high vs low.  Q5 and Q6 are the two that pull the voltage up.  Q8 is the "master" which is switched on or off depending on TIA or MARIA mode.  The base is the middle pin.  Then with the flat side on the west, the output pin would be on the south.

Thanks, I'll give it a shot, but I must be honest that 90% of what you said doesn't make sense to me. ?  I'm sure once I open it up and find some schematics online it will be a little more clear. :D   In the meantime, I'm going to try to acquire another 7800 to test to see if this is a problem with the QT or my 7800.

 

Thanks again!

John

 

Link to comment
Share on other sites

AtariAge member @McCallister has graciously offered to send me a couple 7800's to test with :) and they should arrive tomorrow; fingers crossed they just work and it's my 7800 that has the problem.  ?  If none of them work, I'll assume my 7800 is fine and then we'll need to explore options to hopefully resolve the issue by updating the design. ?  

 

In the meantime, above I mention the voltage I'm measuring at the joystick inputs when they're open and it's between 5.2V and 3.6V.  Is this okay?  I added a pull up resistor bank (10K) and the voltage stays between 5.1 and 5.5 volts.  Do you recommend that we add pull-up resistors to the joystick inputs?  I'm worried that when it dips to 3.6 volts it may register as a low to the mux, but then again that may be well within the tolerance.

 

Any suggestions are welcome!

 

Thanks,

John

 

Link to comment
Share on other sites

TTL spec says anything 2V or above is high.  And for the joystick inputs, the multiplexer doesn't identify the voltage as high or low.  It's merely a relay that simulates connects plugging in one joystick or the other.  That's what makes this a nice design, if it is made to work.

 

But still, the 6532 of the 2600 has internal pull-ups on each line in input mode.  So it should be reading near 5V on the joystick inputs at least.  Then the 2600 adds a 10K pull-up resistor for the button.  The 7800 should also have that pull-up on the joystick lines since it also uses the 6532.

Link to comment
Share on other sites

12 hours ago, ChildOfCv said:

TTL spec says anything 2V or above is high.  And for the joystick inputs, the multiplexer doesn't identify the voltage as high or low.  It's merely a relay that simulates connects plugging in one joystick or the other.  That's what makes this a nice design, if it is made to work.

Okay great, thx for the info, that makes sense about the mux.

Quote

But still, the 6532 of the 2600 has internal pull-ups on each line in input mode.  So it should be reading near 5V on the joystick inputs at least.  Then the 2600 adds a 10K pull-up resistor for the button.  The 7800 should also have that pull-up on the joystick lines since it also uses the 6532.

Okay, so since the mux is really just a relay, there really isn't a need for a pull up resistor on the joystick inputs before the mux, right?   It sounds like the pullups in the Atari will take care of it then.  I'm still a bit confused why the measurement at the joystick inputs fluctuates between 5.2V to 3.6, but perhaps that doesn't matter since it's above 2.0V?

 

Thanks again!

John

 

Edited by johnnywc
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...