I'm gonna explain this in detail in case someone happens along who wants to learn what this is doing and how/why it works the way it does: As several folks have noted, the resistors are for the paddle inputs pulling them back up to 5v quicker so that they can be read as digital inputs (since pin 7 is 5v.) The VCS/2600 is kinda unique in that most of those pins go to one of the three chips that make up the machine: The MOS 6532 RIOT. It's got I/O pins that are normally read as inputs for a joystick, but some of them are turned into outputs for use with this controller. You've got direct control over whether pins are input or output, and when they're set for output, you have control over whether or not they are logic high or low. You NEVER set the pin to output and to output high on the 2600. Here's the pinout of the connector for reasons why: 1 JS Up 2 JS Down 3 JS Left / P2 Fire 4 JS Right / P1 Fire 5 P1 pot 6 JS Fire 7 +5v 8 Gnd 9 P2 pot There are multiple pinouts of the Atari connector … but this one (for the C64) is most accurate as to what's going on with the connector. Each of those things that is normally an input has a "pull up" resistor to 5v to ensure that the pins read as a known state whether there's anything connected to them or not. If a joystick is connected, the nine pins connect to "nothing" (but pulled to high) until the joystick is used, in which case the joystick will ground one of the JS inputs. Why you never risk outputting a 1 is that if someone has a joystick plugged in and moves the stick while you're outputting logic high, you have an instant short to ground! So you keep the pin on input and only flip it to output after you've set it to output ground. If a joystick is grounding the pin the same time the RIOT chip is … no harm! But then you come to the pots… The joystick doesn't connect them to anything. A resistor still drags the voltage up towards +5v, but it's far from instant. In the Atari, the TIA (Television Interface Adapater AKA "special sauce") chip does magic to turn the pot's rotation position into a number. But we don't want a number, we want a binary low or high. So we use a smaller resistor that makes it read as "high" faster, and we ground it to get a low, like with any other input. So now you have the recipe: Set output _value_ of the four direction pins to 0 (even though they're still inputs!) Then, each time we read the inputs, we: Set pin 1 to output (0) Read P1 pot and test it for high/low to get button 1 Read P2 pot and test it for high/low to get button 2 Read JS Fire to get button 3 Set pin 1 to input Sit pin 2 to output (0) Read P1 pot and test it for high/low got get button 4 : Again that all happens SO fast you don't even see it. Pretty nifty! There are four kinds of controllers from the day and a fifth that get used today. I think I've explained three of them. Omega Race had its own piggyback controller which sits between the Atari and your standard joystick controller to give you a second fire button (on pin 9). I don't know if it uses a resistor like the keyboard controller does to ensure that the signal returns to logic high faster or not. The last is a modern thing: The Genesis controller. It works by putting button C on pin 9. But it's a little more complicated than that. See the Genesis controller has more buttons than you can possibly read from a classic "atari style" joystick port. Or rather, I should say more pins than you can read from a standard Sega joystick port. THEY ARE NOT THE SAME! Pin 7 on the Atari port is permanently +5v. On Sega ports, it's pin 5 that's permanently +5v. And remember what happens when you plug in something that accidentally connects +5v to GND: Magic smoke happens! Turns out the Genesis controller uses +5v to power a chip that selects between two sets of inputs. One of them is the A button and Start. The other is the D-Pad, B, and C. If the chip expects +5v on pin 5 … it'll get something close to that by accident from the P1 pot's pullup resistor. Since pin 7 is permanently high (being +5v for Atari and C64), it guarantees the controller is set to read the D-pad (pins 1-4), B (pin 6), and C (pin 9). Pin 9 has no fast pull-up resistor, but it's fine the way modern Atari games use it since they're not scanning a keypad and they're coded to know what to expect. I've been considering the C64 and Atari ports synonymous. I don't have a C64 schematic in front of me to know if the pot lines have any pull-up resistor to +5v on the C64. They SHOULD because you should never leave a pin floating with any kind of MOS technology, and the SID chips are NMOS or HMOS (depending on the vintage…) Still, some people have reported that use of Genesis controllers have fried their SID chips. How realistically likely is that? I'm gonna say pretty low since there are so many other variables, but I'm pretty sure the Atari is safe to use them this way. If in doubt or to be 1000% safe for the C64, make an adapter cable that leaves pin 5 floating (which is safe to do as it's an intended state) and connects pin 7 on the port to controller pins 5 and 7. Through 4.7k resistors if you really want to be 10,000% safe I guess. But the TIA isn't gonna flinch at having a digital button connected to its paddle inputs, so … don't worry about it too much unless you want to also think about the C64. The other thing to consider is the 7800 which used resistor tricks to make its two fire buttons work. The VCS/2600 doesn't see or care about the difference.
As pin 7 is permanently 5V, these two resistors are clearly pull-ups for the Atari inputs 5 and 9. Looking at the schematics of the VCS main board, these pins are later connected to a 0.068 (uF?) capacitor and to the TIA chip that does its weird analog to digital conversion. My guess here is that the existing pull-up capabilities are not enough to charge the capacitor to its idle +5V state fast enough. Therefore the resistors here help with this issue. The pin 6 line on the other hand is internally connected to only a 220pF capacitor (for noise reduction, probably) and obviously this poses no problem for the circuitry.
This is interesting to see you make a Universal Atari 12-button Controller for use on the Atari 2600 VCS. I already have the original keypad controller that came with the "Star Raiders" game cartridge, so I really don't need to make this Controller that you are working on. However I am sure that the viewers who don't have one of these appreciate your video.
To pile on what I’m sure others have written regarding the resistor circuit @6:45 , pins 5 and 9 are the paddle sense input pins, which via the 5v dc pin 7 supply gives a fixed voltage to the paddle inputs , unless a button on columns 2 or 3 are pressed. So the paddle inputs, being analog that produces a 0-255 value from a voltage , get repurposed as digital column binary inputs by setting them to one of two voltages. The joystick port as 5 binary logic inputs (L R T B FIRE) and 2 analog (PAD1 and PAD2 ). You need to provide 4 rows and 3 columns input values (7 input bits) but you only have 5 binary input , so it’s repurposing the 2 analog inputs as binary. Also by having a fixed resistance in place providing a known voltage to the 2 paddle inputs that could be used for the system to detect that a paddle was plugged in , maybe.
Pin 7 is +5V, Pin 8 is Gnd, Pin 5 & 9 are paddle inputs, pin 6 is joystick trigger, and all three are handled by the TIA chip, Pin 1-4 are joystick 2 directions and high nibble of port B on the RIOT chip, low nibble of port B is joystick 1. There are 4 paddles and 2 joystick triggers. Port A on the RIOT chip handles the 5 switches on the front of the 2600, and not the on/off switch. I believe paddle use 10K pots wire between Gnd and +5V with center contact input back through either pins 5 or 9. (paddles 1/2 & 3/4) RIOT is Ram Input Output Timer chip. Pins 1-4 are pulsed low (output mode) individually to scan the rows and a change in state of either paddles or trigger button will register an input/key press. Paddles are either 1/2 charged or fully discharged and ditto for the trigger button, charged or fully discharged.
Thanks for sharing. One thing I recommend is ‘tinning’ the wires before mounting them into screw down connector so don’t have to worry about strands of copper breaking.
Excellent suggestion! The wires on these cables are very small, so I ended up folding the exposed end to double the thickness of the strands, then inserting into the screw-down connector. Tinning would have made for a much stronger and longer lasting connection.
Nice job. I got Star Raider new for Christmas one year. I already had Starmaster and loved it, so I figured Star Raiders would be even better. Sadly, I didn't care for it that much. The enemy ships kept zipping around me and I couldn't hit anything. I later played the 6200 version and liked it. Phaser Patrol is no my favorite game of this genre on the 2600. What's interesting to think about is that the Atari 2600, C64 and even Amiga, could have all supported a three-button joystick. The normal button, plus two more connected to the analog inputs. Nobody made one because there were no games to support it, and nobody made any games to support it because such a joystick didn't exist. Catch-22.
Nice job! It looks like Star Raiders game play functionality isn't too different from Starpath's Phaser Patrol. In the latter, it used a difficulty switch to change from view screen to map mode, and the B/W switch to toggle the shields, eliminating the need for a keyboard controller.
True, but I like using the console switches, makes it easier to imagine it being part of the switches on a space ship, as opposed to the video keypad. When dealing with the video keypad, the text on the overlay is quite small, though it might have been easier to read when I was younger. Also trying to press the keys through the overlay just doesn't have a very positive tactile feel
Thank you for the feedback! I never really thought about this, but I do think more than one button press may register simultaneously in any row, as each column is routed to a distinct pin (schematic at 3:51). The cartridge will turn on one row at a time via pins 1,2,3,4 -- so multiple button presses in a column can't register simultaneously (in the strict sense). I recently learned that there is no direct hardware support in the console for the the 12-button controller, and that each cartridge programmer had to implement their own scanning logic. There could be some weird implementations in the wild where simultaneous button press are ignored! en.wikipedia.org/wiki/Atari_joystick_port#Keyboard_controllers
DYK the touch pad utilizes the ataris bidirectional controller lines? It's theoretically possible to make a "game link" cable and have two consoles communicate to each other. IIRC someone on AtariAge made a proof of concept of this, but ultimately went nowhere.
Star Raiders should have came out on the intelevision or the ColecoVision because the controllers for those systems had a number pad along with the joystick and buttons
I figured this one out two weeks ago for another project I'm working on :) Pin 7 provides +5V in all (most?) Atari/Commodore/Sega DB9 joystick ports. Also, pins 5,9 are the same inputs for paddles and therefore must be analog inputs. In this case, the CPU determines the analog voltage level (something between 0 and 5V) by measuring the time it takes for the given voltage to charge an internal capacitor. If we left the pins floating, then the CPU presumably can't determine if the voltage is truly zero since it is taking an infinite amount of time to charge the internal capacitor (I know, WE can deduce this, but maybe the CPU doesn't have the capability). So, a resistor is put in place to anchor the proper "zero" state, which is bypassed when a button is pressed.
My explanation above is over-complicated and somewhat incorrect. There is a simpler explanation: we need to limit the current to pins 5,9 in the event of a supply failure or short circuit. We can't leave the pins floating because the CPU expects them high at 5V all the time.
@@SteveGuidi NO NO NO pin 7 is NOT +5v on Sega! That's a big mistake to make since shorting ground to pin 5 on a Sega Mk III, Master System, Megadrive/Genesis will SHORT THE CONSOLE. Sega uses pin 5 for +5v. See schematics on gamesx for info. (No link because TH-cam will interpret any link as automatically spam because Google is run by morons.)
I'm not very familiar with the Atari 800 series, but you can probably program the computer to do so with either BASIC or assembly language (does Atari BASIC give access to joystick port pins?). Robin Harbron programmed the Commodore 64 to interact with the device: th-cam.com/video/TJlBSv8Z6Zc/w-d-xo.html.
I'm gonna explain this in detail in case someone happens along who wants to learn what this is doing and how/why it works the way it does:
As several folks have noted, the resistors are for the paddle inputs pulling them back up to 5v quicker so that they can be read as digital inputs (since pin 7 is 5v.) The VCS/2600 is kinda unique in that most of those pins go to one of the three chips that make up the machine: The MOS 6532 RIOT. It's got I/O pins that are normally read as inputs for a joystick, but some of them are turned into outputs for use with this controller. You've got direct control over whether pins are input or output, and when they're set for output, you have control over whether or not they are logic high or low. You NEVER set the pin to output and to output high on the 2600. Here's the pinout of the connector for reasons why:
1 JS Up
2 JS Down
3 JS Left / P2 Fire
4 JS Right / P1 Fire
5 P1 pot
6 JS Fire
7 +5v
8 Gnd
9 P2 pot
There are multiple pinouts of the Atari connector … but this one (for the C64) is most accurate as to what's going on with the connector. Each of those things that is normally an input has a "pull up" resistor to 5v to ensure that the pins read as a known state whether there's anything connected to them or not.
If a joystick is connected, the nine pins connect to "nothing" (but pulled to high) until the joystick is used, in which case the joystick will ground one of the JS inputs. Why you never risk outputting a 1 is that if someone has a joystick plugged in and moves the stick while you're outputting logic high, you have an instant short to ground! So you keep the pin on input and only flip it to output after you've set it to output ground. If a joystick is grounding the pin the same time the RIOT chip is … no harm!
But then you come to the pots… The joystick doesn't connect them to anything. A resistor still drags the voltage up towards +5v, but it's far from instant. In the Atari, the TIA (Television Interface Adapater AKA "special sauce") chip does magic to turn the pot's rotation position into a number. But we don't want a number, we want a binary low or high. So we use a smaller resistor that makes it read as "high" faster, and we ground it to get a low, like with any other input.
So now you have the recipe:
Set output _value_ of the four direction pins to 0 (even though they're still inputs!) Then, each time we read the inputs, we:
Set pin 1 to output (0)
Read P1 pot and test it for high/low to get button 1
Read P2 pot and test it for high/low to get button 2
Read JS Fire to get button 3
Set pin 1 to input
Sit pin 2 to output (0)
Read P1 pot and test it for high/low got get button 4
:
Again that all happens SO fast you don't even see it. Pretty nifty!
There are four kinds of controllers from the day and a fifth that get used today. I think I've explained three of them. Omega Race had its own piggyback controller which sits between the Atari and your standard joystick controller to give you a second fire button (on pin 9). I don't know if it uses a resistor like the keyboard controller does to ensure that the signal returns to logic high faster or not. The last is a modern thing: The Genesis controller. It works by putting button C on pin 9. But it's a little more complicated than that.
See the Genesis controller has more buttons than you can possibly read from a classic "atari style" joystick port. Or rather, I should say more pins than you can read from a standard Sega joystick port. THEY ARE NOT THE SAME! Pin 7 on the Atari port is permanently +5v. On Sega ports, it's pin 5 that's permanently +5v. And remember what happens when you plug in something that accidentally connects +5v to GND: Magic smoke happens!
Turns out the Genesis controller uses +5v to power a chip that selects between two sets of inputs. One of them is the A button and Start. The other is the D-Pad, B, and C. If the chip expects +5v on pin 5 … it'll get something close to that by accident from the P1 pot's pullup resistor. Since pin 7 is permanently high (being +5v for Atari and C64), it guarantees the controller is set to read the D-pad (pins 1-4), B (pin 6), and C (pin 9). Pin 9 has no fast pull-up resistor, but it's fine the way modern Atari games use it since they're not scanning a keypad and they're coded to know what to expect.
I've been considering the C64 and Atari ports synonymous. I don't have a C64 schematic in front of me to know if the pot lines have any pull-up resistor to +5v on the C64. They SHOULD because you should never leave a pin floating with any kind of MOS technology, and the SID chips are NMOS or HMOS (depending on the vintage…) Still, some people have reported that use of Genesis controllers have fried their SID chips. How realistically likely is that? I'm gonna say pretty low since there are so many other variables, but I'm pretty sure the Atari is safe to use them this way. If in doubt or to be 1000% safe for the C64, make an adapter cable that leaves pin 5 floating (which is safe to do as it's an intended state) and connects pin 7 on the port to controller pins 5 and 7. Through 4.7k resistors if you really want to be 10,000% safe I guess. But the TIA isn't gonna flinch at having a digital button connected to its paddle inputs, so … don't worry about it too much unless you want to also think about the C64.
The other thing to consider is the 7800 which used resistor tricks to make its two fire buttons work. The VCS/2600 doesn't see or care about the difference.
As pin 7 is permanently 5V, these two resistors are clearly pull-ups for the Atari inputs 5 and 9. Looking at the schematics of the VCS main board, these pins are later connected to a 0.068 (uF?) capacitor and to the TIA chip that does its weird analog to digital conversion. My guess here is that the existing pull-up capabilities are not enough to charge the capacitor to its idle +5V state fast enough. Therefore the resistors here help with this issue.
The pin 6 line on the other hand is internally connected to only a 220pF capacitor (for noise reduction, probably) and obviously this poses no problem for the circuitry.
This is interesting to see you make a Universal Atari 12-button Controller for use on the Atari 2600 VCS. I already have the original keypad controller that came with the "Star Raiders" game cartridge, so I really don't need to make this Controller that you are working on. However I am sure that the viewers who don't have one of these appreciate your video.
To pile on what I’m sure others have written regarding the resistor circuit @6:45 , pins 5 and 9 are the paddle sense input pins, which via the 5v dc pin 7 supply gives a fixed voltage to the paddle inputs , unless a button on columns 2 or 3 are pressed. So the paddle inputs, being analog that produces a 0-255 value from a voltage , get repurposed as digital column binary inputs by setting them to one of two voltages.
The joystick port as 5 binary logic inputs (L R T B FIRE) and 2 analog (PAD1 and PAD2 ). You need to provide 4 rows and 3 columns input values (7 input bits) but you only have 5 binary input , so it’s repurposing the 2 analog inputs as binary.
Also by having a fixed resistance in place providing a known voltage to the 2 paddle inputs that could be used for the system to detect that a paddle was plugged in , maybe.
Pin 7 is +5V, Pin 8 is Gnd, Pin 5 & 9 are paddle inputs, pin 6 is joystick trigger, and all three are handled by the TIA chip, Pin 1-4 are joystick 2 directions and high nibble of port B on the RIOT chip, low nibble of port B is joystick 1. There are 4 paddles and 2 joystick triggers. Port A on the RIOT chip handles the 5 switches on the front of the 2600, and not the on/off switch. I believe paddle use 10K pots wire between Gnd and +5V with center contact input back through either pins 5 or 9. (paddles 1/2 & 3/4) RIOT is Ram Input Output Timer chip. Pins 1-4 are pulsed low (output mode) individually to scan the rows and a change in state of either paddles or trigger button will register an input/key press. Paddles are either 1/2 charged or fully discharged and ditto for the trigger button, charged or fully discharged.
Always appreciate that Atari love.
Thanks for sharing. One thing I recommend is ‘tinning’ the wires before mounting them into screw down connector so don’t have to worry about strands of copper breaking.
Excellent suggestion! The wires on these cables are very small, so I ended up folding the exposed end to double the thickness of the strands, then inserting into the screw-down connector. Tinning would have made for a much stronger and longer lasting connection.
Nice job. I got Star Raider new for Christmas one year. I already had Starmaster and loved it, so I figured Star Raiders would be even better. Sadly, I didn't care for it that much. The enemy ships kept zipping around me and I couldn't hit anything. I later played the 6200 version and liked it. Phaser Patrol is no my favorite game of this genre on the 2600.
What's interesting to think about is that the Atari 2600, C64 and even Amiga, could have all supported a three-button joystick. The normal button, plus two more connected to the analog inputs. Nobody made one because there were no games to support it, and nobody made any games to support it because such a joystick didn't exist. Catch-22.
Star raiders was one of my top 10 favorites.
Nice job!
It looks like Star Raiders game play functionality isn't too different from Starpath's Phaser Patrol.
In the latter, it used a difficulty switch to change from view screen to map mode, and the B/W switch to toggle the shields, eliminating the need for a keyboard controller.
That's quite clever! It seems like you might need a co-pilot if the console is too far from the joystick :)
True, but I like using the console switches, makes it easier to imagine it being part of the switches on a space ship, as opposed to the video keypad.
When dealing with the video keypad, the text on the overlay is quite small, though it might have been easier to read when I was younger. Also trying to press the keys through the overlay just doesn't have a very positive tactile feel
Yes, that's one of the things I never liked about the VTP -- the remote-control-style buttons with little tactile feedback.
Cool project. So if I understand correctly, it looks like each row should be independent, but only one button will work at a time on each row?
Thank you for the feedback! I never really thought about this, but I do think more than one button press may register simultaneously in any row, as each column is routed to a distinct pin (schematic at 3:51). The cartridge will turn on one row at a time via pins 1,2,3,4 -- so multiple button presses in a column can't register simultaneously (in the strict sense).
I recently learned that there is no direct hardware support in the console for the the 12-button controller, and that each cartridge programmer had to implement their own scanning logic. There could be some weird implementations in the wild where simultaneous button press are ignored!
en.wikipedia.org/wiki/Atari_joystick_port#Keyboard_controllers
DYK the touch pad utilizes the ataris bidirectional controller lines? It's theoretically possible to make a "game link" cable and have two consoles communicate to each other. IIRC someone on AtariAge made a proof of concept of this, but ultimately went nowhere.
That is really neat! I'll have to dig up the specs and data on this from AtariAge. Would love to explore this further.
Star Raiders should have came out on the intelevision or the ColecoVision because the controllers for those systems had a number pad along with the joystick and buttons
Codebreaker: Magic!
Is the PIN 7 arrangement a Column Strobe?
More accurate repeatable drilling tip: Drill Press
I figured this one out two weeks ago for another project I'm working on :)
Pin 7 provides +5V in all (most?) Atari/Commodore/Sega DB9 joystick ports. Also, pins 5,9 are the same inputs for paddles and therefore must be analog inputs. In this case, the CPU determines the analog voltage level (something between 0 and 5V) by measuring the time it takes for the given voltage to charge an internal capacitor. If we left the pins floating, then the CPU presumably can't determine if the voltage is truly zero since it is taking an infinite amount of time to charge the internal capacitor (I know, WE can deduce this, but maybe the CPU doesn't have the capability). So, a resistor is put in place to anchor the proper "zero" state, which is bypassed when a button is pressed.
My explanation above is over-complicated and somewhat incorrect. There is a simpler explanation: we need to limit the current to pins 5,9 in the event of a supply failure or short circuit. We can't leave the pins floating because the CPU expects them high at 5V all the time.
@@SteveGuidi NO NO NO pin 7 is NOT +5v on Sega! That's a big mistake to make since shorting ground to pin 5 on a Sega Mk III, Master System, Megadrive/Genesis will SHORT THE CONSOLE. Sega uses pin 5 for +5v. See schematics on gamesx for info. (No link because TH-cam will interpret any link as automatically spam because Google is run by morons.)
Interesting. I wonder if this works for the atari 800 version.
I'm not very familiar with the Atari 800 series, but you can probably program the computer to do so with either BASIC or assembly language (does Atari BASIC give access to joystick port pins?). Robin Harbron programmed the Commodore 64 to interact with the device: th-cam.com/video/TJlBSv8Z6Zc/w-d-xo.html.