Jump to content
IGNORED

Joystick multiplexer help


gauauu

Recommended Posts

18 minutes ago, johnnywc said:

However, when I add in the inverter with the pull up resistor and have it switching between 2 bus transceivers, when I measure the output at the Atari for a direction it measures about 5V for open (4.98) but only drops to 3.68V when a switch on 1 joystick is closed.  I assume this is because the value is rapidly changing from 0V for the closed switch on Joystick 1 and 5V for the matching open switch on Joystick 2?

Yeah.  The meter is probably averaging the voltage.  I guess player 2 gets more select time?

 

20 minutes ago, johnnywc said:

Regarding the interference, it does get much worse when a switch is active (ie. you press the button or move in a direction) and more prevalent when you combine them.  Also, the interference is greater when switches on the joystick that is triggered on low pin 9 (DUMP_PORTS = 0) are active vs. the other joystick.

You know, I wonder if you should only be activating the dump during the vertical blanking period?  Just for the fun of it, activate the dump port and the vblank itself at the same time, and turn both off at the same time.  This will still give you the toggle, but would help to distinguish noise from the switchbox vs the possibility that the dumping is what causes the weirdness.  Yeah, you can't effectively read the inputs that way, but let's see how it affects the video and work from there.

 

By the way, did you say that this only happens on the 2600?  Because I have an unmodified 7800 but not a 2600.  I could do experiments on mine if I could at least duplicate the behavior.

Link to comment
Share on other sites

2 hours ago, ChildOfCv said:

Yeah.  The meter is probably averaging the voltage.  I guess player 2 gets more select time?

Okay, that makes sense.  Yes Player 2 gets 192 scanlines of select since I set DUMP_PORTS right after vertical blank is done and then switch to player 1 when I turn on VBLANK at the beginning of overscan, so that gets 70 scanlines.  Doing some quick math, Player 2 is 192/262*5.0V = 3.66 V and Player 1 should be 70/262*5.0 = 1.33, which is almost exactly what I'm measuring. :D 

2 hours ago, ChildOfCv said:

Thanks

You know, I wonder if you should only be activating the dump during the vertical blanking period?  Just for the fun of it, activate the dump port and the vblank itself at the same time, and turn both off at the same time.  This will still give you the toggle, but would help to distinguish noise from the switchbox vs the possibility that the dumping is what causes the weirdness.  Yeah, you can't effectively read the inputs that way, but let's see how it affects the video and work from there.

Good idea, I'll update my test program and see if it makes a difference.  I already have the ability to turn off switching using the left difficulty switch and then I can use the right difficulty switch to have DUMP_PORTS be a constant 1 or 0.  As I mentioned above, I'm activating the DUMP_PORTS right after vblank is over and turning it off at the beginning of overscan.  I can switch this logic so I'm dumping the ports at the beginning of overscan and resetting it back to 0 at the end of vertical blank and see if that makes any difference.

2 hours ago, ChildOfCv said:

 

By the way, did you say that this only happens on the 2600?  Because I have an unmodified 7800 but not a 2600.  I could do experiments on mine if I could at least duplicate the behavior.

Unfortunately I only have a modified 7800 so I can't test if the interference is there, but I will test to see if there is interference on the modded 7800.  I have a modded 2600, modded 7800 and an unmodded 2600 which is what I'm doing most of my testing with.

 

Thanks for the ideas, I'll post my results soon.

 

John

Link to comment
Share on other sites

One other item to check:  Could you verify that you get 100 ohms on the TV end of your RF cable?  If it turns out that the output connector is the issue, then we've been spending a lot of time chasing our tail.

 

Also, how close are your electronics to the Atari?  Does moving them away help with the interference?

Link to comment
Share on other sites

51 minutes ago, ChildOfCv said:

One other item to check:  Could you verify that you get 100 ohms on the TV end of your RF cable?  If it turns out that the output connector is the issue, then we've been spending a lot of time chasing our tail.

Will do!  I know Nathan is seeing the same interference on his machine also so I don't think it's just my output connector but I'll check.

51 minutes ago, ChildOfCv said:

 

Also, how close are your electronics to the Atari?  Does moving them away help with the interference?

A few feet, I will test by moving the board (I have it connected to a 12 ft cable) and see if that makes a difference.

 

Thanks for the suggestions!

 

Link to comment
Share on other sites

Okay, I had a few minutes to run some tests:

 

On the unmodded RF 4-switch Atari:

 

1. If switching is disabled, the interference is greatly reduced to only a few sparkles when you move either joystick.  The interference is the same whether or not DUMP_PORTS is enabled or disabled.

2. The distance of the circuit to the Atari does not seem to have any noticeable effect on the interference (when switching is enabled).  I had it right on the Atari vs. 6 feet away.

 

On the AV-modded 7800, the circuit works perfectly and there is absolutely zero interference (the picture is crystal clear) and there is no interference when either or both of the joysticks are moved in multiple or different directions.  This is consistent with what we saw in Nathan's original design that used multi-plexers; no interference on AV-modded Ataris.  The interference is only on unmodded Atari's using RF.

 

I'm not exactly sure how to measure the ohms at the TV connector for the RF Atari.  I have a potentiometer that I can measure ohms with but I'm not sure what I'm measuring across.  Do I disconnect the cable from the TV?  Apologies for the simple question! :)  

 

 

Link to comment
Share on other sites

2 hours ago, ChildOfCv said:

One other item to check:  Could you verify that you get 100 ohms on the TV end of your RF cable?  If it turns out that the output connector is the issue, then we've been spending a lot of time chasing our tail.

I haven't measured the ohms off the connector, but I've tested on a Jr, a Vader, and a 4-switch woody, and get the same issues on each with the 4-player adapter (and with a crystal clear signal without the adapter)

Link to comment
Share on other sites

Just now, gauauu said:

I haven't measured the ohms off the connector, but I've tested on a Jr, a Vader, and a 4-switch woody, and get the same issues on each with the 4-player adapter (and with a crystal clear signal without the adapter)

Hi Nathan, thx for the clarification.  Hmm, I thought the 4 player adapter you put together used the grounding logic and not the chips and you weren't seeing interference with it (just control issues)?  Do you mean the first iteration of the adapter that used the multiplexers?  Maybe I'm confusing the two?

Link to comment
Share on other sites

6 minutes ago, gauauu said:

Yes, I'm sorry, I mean the previous iterations. (my point was that I doubt it's related to the TV connector specifically)

Gotcha, thx for the clarification!  I was panicked that we didn't have a solution that had at least the interference cleared up. :) I agree, I don't think the interference is related to the connector (or at least one specific connector).  

Link to comment
Share on other sites

56 minutes ago, gauauu said:

I haven't measured the ohms off the connector, but I've tested on a Jr, a Vader, and a 4-switch woody, and get the same issues on each with the 4-player adapter (and with a crystal clear signal without the adapter)

Ah, so it sounds like I could duplicate it on the 7800 and maybe track down the cause and a potential solution.

Link to comment
Share on other sites

Well, actually... looking at the 2600 schematic (the official one in the field service manual, not the reverse-engineered one-page one), the power from the regulator is filtered to a couple of sub-circuits.  The one that powers the modulator just happens to be the same one that provides controller power as well as the pull-ups for the TIA inputs (don't ask me why).  This actually offers a clue:  The multiplexer is on the same circuit as the modulator is, so any little ripples it causes will affect it.

 

The 10K resistors that are on the input lines only pull 0.5mA.  A 74LS or 74HC chip can pull up to 50mA, or 100 times that much.

 

So then I remembered that there's an Atari trackball, which also uses electronics.  So what's its secret?  Well, look at its schematic:  https://www.atariage.com/2600/archives/schematics/Schematic_2600_CX22_Low.html

 

Pin 7 is connected to a 15uH inductor to block transient current to/from the Atari, then served by two capacitors in parallel, a 10uF and a .1uF to provide both short term and longer term demands for the electronics.

 

Ignore the 100K and 8200 voltage divider--that's just biasing voltage for the op-amps.

 

So the inductor and capacitor circuit may be what you're looking for.

Link to comment
Share on other sites

In addition, if you use the 74HC241 or 74HCT241, you can reduce power consumption even more by using larger pull-up resistors in your resistor network.  74HC series requires only .001mA for an input.  So you could easily get away with 1M per resistor there.  Much better than the 1mA pulled by each of the 4.7K pull-ups when its direction or button is pressed.

Link to comment
Share on other sites

26 minutes ago, ChildOfCv said:

Well, actually... looking at the 2600 schematic (the official one in the field service manual, not the reverse-engineered one-page one), the power from the regulator is filtered to a couple of sub-circuits.  The one that powers the modulator just happens to be the same one that provides controller power as well as the pull-ups for the TIA inputs (don't ask me why).  This actually offers a clue:  The multiplexer is on the same circuit as the modulator is, so any little ripples it causes will affect it.

 

The 10K resistors that are on the input lines only pull 0.5mA.  A 74LS or 74HC chip can pull up to 50mA, or 100 times that much.

 

So then I remembered that there's an Atari trackball, which also uses electronics.  So what's its secret?  Well, look at its schematic:  https://www.atariage.com/2600/archives/schematics/Schematic_2600_CX22_Low.html

 

Pin 7 is connected to a 15uH inductor to block transient current to/from the Atari, then served by two capacitors in parallel, a 10uF and a .1uF to provide both short term and longer term demands for the electronics.

 

Ignore the 100K and 8200 voltage divider--that's just biasing voltage for the op-amps.

 

So the inductor and capacitor circuit may be what you're looking for.

For a quick test of this (since components may not be readily at hand) would it be possible to NOT connect the +5v pin from the Atari and use an an external 5v power source? 

 

Kinda like what I do for my homemade Intellivision controller that uses an Arduino for its guts. The Intellivision doesn't have a 5v pin on the controller, so I use a wall adapter for the 5v power to the Arduino, and I have the ground pin of the controller connected to the ground pin of my power supply. 

 

 

  • Like 1
Link to comment
Share on other sites

1 hour ago, ChildOfCv said:

Well, actually... looking at the 2600 schematic (the official one in the field service manual, not the reverse-engineered one-page one), the power from the regulator is filtered to a couple of sub-circuits.  The one that powers the modulator just happens to be the same one that provides controller power as well as the pull-ups for the TIA inputs (don't ask me why).  This actually offers a clue:  The multiplexer is on the same circuit as the modulator is, so any little ripples it causes will affect it.

 

The 10K resistors that are on the input lines only pull 0.5mA.  A 74LS or 74HC chip can pull up to 50mA, or 100 times that much.

 

So then I remembered that there's an Atari trackball, which also uses electronics.  So what's its secret?  Well, look at its schematic:  https://www.atariage.com/2600/archives/schematics/Schematic_2600_CX22_Low.html

 

Pin 7 is connected to a 15uH inductor to block transient current to/from the Atari, then served by two capacitors in parallel, a 10uF and a .1uF to provide both short term and longer term demands for the electronics.

 

Ignore the 100K and 8200 voltage divider--that's just biasing voltage for the op-amps.

 

So the inductor and capacitor circuit may be what you're looking for.

This all sounds very promising!  

 

Could you recommend a 15uh inductor I should pick up?  I just did a general search on Mouser and there's a bunch and the price range is wide (50 cents to 5 bucks) and I'm not sure what the difference is. :| Looks like there are fixed, coupled, each with different power draw, resistance, etc.  Also any specifics on the capacitors would be helpful too. :)  I'm looking at the diagram and I think I see the capacitors, the .1 and .22?  I'm not sure whre the 10uF one is.  Also, what is the symbol right below the inductor that has 10/16 next to it?  Is that a capacitor too?  Maybe that's the 10uF capacitor?  Sorry for all the basic questions!  

59 minutes ago, ChildOfCv said:

In addition, if you use the 74HC241 or 74HCT241, you can reduce power consumption even more by using larger pull-up resistors in your resistor network.  74HC series requires only .001mA for an input.  So you could easily get away with 1M per resistor there.  Much better than the 1mA pulled by each of the 4.7K pull-ups when its direction or button is pressed.

Hmm, it looks like the 74HCx241 is an octal buffer/line driver.  So this would replace the bus transceiver?  May I ask, what is the difference between the 74HCT241 and 74HC241?  Also, how do these differ from the 74HC244 octal buffer that I was using before?  Regarding the resistor network, do you mean I could use a 1M RN in place of the 4.7K RN that I'm currently using to reduce the power consumption if we switch to the 74HC241 vs the 244?

 

Since a lot of these components are cheap (and the big cost is the shipping and the time to have them shipped), maybe I can just get a bunch of different types that you think may work so I have them on hand.  

 

Again, apologies for all the basic questions... I appreciate the education and help! :D 

 

 

Link to comment
Share on other sites

4 hours ago, johnnywc said:

This all sounds very promising!  

 

Could you recommend a 15uh inductor I should pick up?  I just did a general search on Mouser and there's a bunch and the price range is wide (50 cents to 5 bucks) and I'm not sure what the difference is. :| Looks like there are fixed, coupled, each with different power draw, resistance, etc.  Also any specifics on the capacitors would be helpful too. :)  I'm looking at the diagram and I think I see the capacitors, the .1 and .22?  I'm not sure whre the 10uF one is.  Also, what is the symbol right below the inductor that has 10/16 next to it?  Is that a capacitor too?  Maybe that's the 10uF capacitor?  Sorry for all the basic questions!  

Hmm, it looks like the 74HCx241 is an octal buffer/line driver.  So this would replace the bus transceiver?  May I ask, what is the difference between the 74HCT241 and 74HC241?  Also, how do these differ from the 74HC244 octal buffer that I was using before?  Regarding the resistor network, do you mean I could use a 1M RN in place of the 4.7K RN that I'm currently using to reduce the power consumption if we switch to the 74HC241 vs the 244?

 

Since a lot of these components are cheap (and the big cost is the shipping and the time to have them shipped), maybe I can just get a bunch of different types that you think may work so I have them on hand.  

 

Again, apologies for all the basic questions... I appreciate the education and help! :D 

 

 

You'd want a fixed inductor.

 

The polarized capacitor is labeled 10/16 which means 10uF at 16V.  It's not critical that it be exactly 16V, only that it has a good margin of error for handling over 5V.

 

And yeah I guess I should have been less specific about part numbers.  The main thing is that you use HC or HCT technology.  The actual part numbers are based on how the circuit is constructed.  I'm thinking HC because HCT doesn't seem to have the 05 variant.  For the earlier idea of using an inverting buffer and open collector inverters, that would be 74hc240 into 74hc05.

 

So the shopping list would include:

 

15uH inductor

1M resistor network (2)

74HC240 (2)

74HC05 (1)

10uF capacitor

.1uF capacitor

 

By the way, do you still want to try for a 4-player controller?  If so, then maybe instead of using pin 9 as a simple player 1/player 2 select, you could use it to clock a selector IC such as a shift register.  So when you want to read the next player, you'd activate the dump transistor for a short while and then deactivate it.  But then you'd need a way to ensure you're reading player 1, such as resetting the selector if you hold the dump transistor on for longer than a certain amount of time (or maybe if you don't activate it within a certain amount of time).

Edited by ChildOfCv
Link to comment
Share on other sites

8 hours ago, ChildOfCv said:

You'd want a fixed inductor.

 

The polarized capacitor is labeled 10/16 which means 10uF at 16V.  It's not critical that it be exactly 16V, only that it has a good margin of error for handling over 5V.

Thanks, I figured that symbol was another capacitor but the 10/16 threw me off a bit.  :) 

8 hours ago, ChildOfCv said:

 

And yeah I guess I should have been less specific about part numbers.  The main thing is that you use HC or HCT technology.  The actual part numbers are based on how the circuit is constructed.  I'm thinking HC because HCT doesn't seem to have the 05 variant.  For the earlier idea of using an inverting buffer and open collector inverters, that would be 74hc240 into 74hc05.

 

So the shopping list would include:

 

15uH inductor

1M resistor network (2)

74HC240 (2)

74HC05 (1)

10uF capacitor

.1uF capacitor

Excellent!  I have these in my shopping cart @ Mouser; I'll wait a bit in case we end up adding a few more items based on your 'crazy' design above ;)  

 

8 hours ago, ChildOfCv said:

By the way, do you still want to try for a 4-player controller?  If so, then maybe instead of using pin 9 as a simple player 1/player 2 select, you could use it to clock a selector IC such as a shift register.  So when you want to read the next player, you'd activate the dump transistor for a short while and then deactivate it.  But then you'd need a way to ensure you're reading player 1, such as resetting the selector if you hold the dump transistor on for longer than a certain amount of time (or maybe if you don't activate it within a certain amount of time).

Although that sounds tempting and very interesting, I think we should keep it simple with just 2 joysticks as the logic involved for selecting/etc. gets a bit complicated.  Our plan is to allow 4 joysticks on 2 ports by basically using a 2-joystick selector adapter on each port.  Of course that means we can't use a Savekey/etc. in the right joystick port, but that should be fine since the pros (simpler circuit, easier to read and confirm values for each player, less ROM needed, less time needed in vblank/overscan etc.) outweigh the cons.  So, with an adapter connected into each port, for 4 player games we can detect if there is an adapter in each port (INPT1=1, INPT0=0 if an adapter is in the left port and INPT3=1, INPT2=0 if an adapter is in the right port).  Also, we use just one write to VBLANK to read two joysticks, one on each port:

  • DUMP_PORTS=0 you can read Joystick 1/Joystick 3 movement in SWCHA, Joystick 1 button/Joystick 3 button in INPT4 and INPT5 respectively
  • DUMP_PORTS=1 you can read Joystick 2/Joystick 4 movement in SWCHA, Joystick 2 button/Joystick 4 button in INPT4 and INPT5 respectively

Perhaps down the road we can design a 4 joystick adapter on 1 port; that would be a cool project! :thumbsup: 

 

Thanks again for all the help!

John

 

Link to comment
Share on other sites

6 hours ago, ChildOfCv said:

And here's another crazy idea.  It uses discrete logic to simulate a bus transceiver.  I omitted the select logic itself since that's still negotiable.

 

384205070_ScreenShot2019-09-05at1_11_33AM.thumb.png.186c121a67390efbdffa3ed7ff1da448.png

 

Okay, so this looks very interesting and reminds me of my discrete logic class @ UCONN (CS207/208). :D  It all makes sense to me except for the NAND gate connecting the Joystick pin 1's (UP); why is that being used instead of the inverter?  EDIT: I think it's to reduce chip count?  The NAND and inverter have the same logic but using only 4 inverters means just 1 74HC05 is needed and the 11 NAND gates can be accommodated on 3 of the 74HC03's, right?  

 

As for the select logic, if we go with the 2 joystick option, could we use the 12th NAND gate on the 3rd 74HC03 to simulate the 74HC04 inverter?  Meaning we could just pass the select line (after a 1M pull up resister) for selecting Joystick 1 and the inverted value from the NAND gate to select Joystick 2?

 

I would like to add some NAND gates to my order before I checkout; is this one okay?   

 

Thanks again!

John

Link to comment
Share on other sites

2 hours ago, johnnywc said:

I would like to add some NAND gates to my order before I checkout; is this one okay?

Yeah that looks good.

 

2 hours ago, johnnywc said:

I think it's to reduce chip count?

I was using up all the chips before adding new ones, as you guessed.  But actually, you could just use all inverters since that only uses 5 of them.  There is also one NAND gate I forgot to use anyway.

 

And for the simple select logic, you need a pull-up resistor on both sides of the gate.  The input should be a lower resistance like 10K, but the output could be another 1M.

Link to comment
Share on other sites

2 minutes ago, ChildOfCv said:

Yeah that looks good.

Great thanks!  I ordered the 7 items on the shopping list; they should be here by the weekend.

2 minutes ago, ChildOfCv said:

 

I was using up all the chips before adding new ones, as you guessed.  But actually, you could just use all inverters since that only uses 5 of them.  There is also one NAND gate I forgot to use anyway.

Okay, I'm ordering 10 of each to save on costs (plus I'll probably fry a couple while I'm testing lol) so I should be able to mix and match to reduce chip count if needed.

2 minutes ago, ChildOfCv said:

 

And for the simple select logic, you need a pull-up resistor on both sides of the gate.  The input should be a lower resistance like 10K, but the output could be another 1M.

Okay, I have a 10K on the input side in my current design, so I can keep that.  I'll add a 1M on the other end.  Quick question; regarding the design above where we're using the 74HC04 to invert the select line; why isn't a 1M pull up resistor needed for that output?  Does the 74HC04 pull up the value but the 74HC05 does not?  

Link to comment
Share on other sites

1 hour ago, johnnywc said:

Quick question; regarding the design above where we're using the 74HC04 to invert the select line; why isn't a 1M pull up resistor needed for that output?  Does the 74HC04 pull up the value but the 74HC05 does not?

Yeah, a 74HC04 drives both highs and lows, while open collector (74HC05) only drives lows.  Since you have spare gates on either the 74HC05 or one of the 74HC03's, though, why not use one of them for the select line?  That will save you a chip.

 

Link to comment
Share on other sites

19 minutes ago, ChildOfCv said:

Yeah, a 74HC04 drives both highs and lows, while open collector (74HC05) only drives lows.  Since you have spare gates on either the 74HC05 or one of the 74HC03's, though, why not use one of them for the select line?  That will save you a chip.

 

Sounds like a good plan!  I just got the open collector bus transceivers in the mail (74ALS641) so I'm going to swap those in in place of the x245 and diodes to see if that makes a difference, but from what you've found in your research it seems that the interference is most likely being caused by VCC on pin 7 which I won't be able to test until I get the inductor and capacitors in the mail.  It's times like this I really miss having a Radio Shack around! :(  

 

Link to comment
Share on other sites

Update:  The parts came in today so I hope to wire this up in the next few nights.  Silly question before I blow up something; is there a specific direction I should be hooking up the capacitors?  I read online that the inductor doesn't have polarity so that should be okay in any direction (I think) but read about capacitors blowing up if you don't hook them up in the right direction. ? 

 

Any safety tips are appreciated! :thumbsup: :D 

Link to comment
Share on other sites

13 minutes ago, johnnywc said:

Update:  The parts came in today so I hope to wire this up in the next few nights.  Silly question before I blow up something; is there a specific direction I should be hooking up the capacitors?  I read online that the inductor doesn't have polarity so that should be okay in any direction (I think) but read about capacitors blowing up if you don't hook them up in the right direction. ? 

 

Any safety tips are appreciated! :thumbsup: :D 

Only tantalum and electrolytic capacitors are polarized. They have markings (Tantalum a small +, Electrolytics a large stripe with minus signs). Ceramics, MLCCs, regular film capacitors and the like are usually unpolarized and it doesn’t matter which way you put them in. 

 

Edit: just saw the schematic further up and I saw two caps: 1uF and 10uF. Those are electrolytics and are polarized. 

Edited by root42
  • Like 2
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...