ibogost Posted July 1, 2010 Share Posted July 1, 2010 Port A, which is read on SWCHA, is typically used as input to read the P0 and P1 joystick controllers. However, as specified in the Stella Programmers Guide, the port can be set either for input or for output: Port A has an 8 bit wide Data Direction Register (DDR) that is written to at SWACNT (HEX 281) to set each individual pin of Port A to either input or output. The Port A pins are labeled PA0 thru PA7, and writing a "0" to a pins' DDR bit sets that pin as input, and a "1" sets it as an output. For example, writing all 0's to SWACNT (the DDR for Port A) sets PA0 thru PA7 (all 8 pins of Port A) as inputs. If F0 (11110000) were written to SWACNT then PA7, PA6, PA5 & PA4 would be outputs, and PA3, PA2, PA1 & PA0 would be inputs. I'm wondering if anyone has ever used Port A as an output port and communicated with another computer or device from the VCS. If so, what did you do (write a serial communication protocol, for example)? Such a task would also require rigging the two 9-pin joystick ports to act as a DCE device. It's not clear to me how the SWCHA register relates to the 9-pin input device itself, and what sort of hack I'd have to concoct to succeed at transmitting data from the VCS to the foreign computer. Quote Link to comment Share on other sites More sharing options...
Rybags Posted July 1, 2010 Share Posted July 1, 2010 I've done it, although on the computer but the principle is much the same. I used one bit for input, another for output and a third bit as the clock. Not sure about the 2600, but 0->1 transitions take a bit of time on the computer, possibly due to the resistors used on the lines. But you'd probably manage one bit transferred per scanline which equates to about 2K/second. Best method would probably be to change data state while doing a 0->1 transition on clock, do a 1->0 transition on clock "mid-cycle" where you would have the data sampled. As you've got 4 bits of output per port, you could quite easily transmit/receive 4 bits at a time. The scenario I used was A8 to a C64 (via it's serial port). I just wrote a handler on the C64 which acted as a slave. Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted July 1, 2010 Share Posted July 1, 2010 (edited) Port A, which is read on SWCHA, is typically used as input to read the P0 and P1 joystick controllers. However, as specified in the Stella Programmers Guide, the port can be set either for input or for output: Port A has an 8 bit wide Data Direction Register (DDR) that is written to at SWACNT (HEX 281) to set each individual pin of Port A to either input or output. The Port A pins are labeled PA0 thru PA7, and writing a "0" to a pins' DDR bit sets that pin as input, and a "1" sets it as an output. For example, writing all 0's to SWACNT (the DDR for Port A) sets PA0 thru PA7 (all 8 pins of Port A) as inputs. If F0 (11110000) were written to SWACNT then PA7, PA6, PA5 & PA4 would be outputs, and PA3, PA2, PA1 & PA0 would be inputs. I'm wondering if anyone has ever used Port A as an output port and communicated with another computer or device from the VCS. If so, what did you do (write a serial communication protocol, for example)? Such a task would also require rigging the two 9-pin joystick ports to act as a DCE device. It's not clear to me how the SWCHA register relates to the 9-pin input device itself, and what sort of hack I'd have to concoct to succeed at transmitting data from the VCS to the foreign computer. Port A output has been used in a number of applications, here are some from the top of my head: -SaveKey/Atarivox communication -Dumping cartridges -Reading NES controllers -Communication between 2600 consoles I am currently working on a code uploader that uses a RAM cart and parallel communication (one nybble at a time) using port A as input, and an unused port B bit as output. Here is how SWCHA relates to the joystick ports: SWCHA Joystick Port Pin D0 Right 1 D1 Right 2 D2 Right 3 D3 Right 4 D4 Left 1 D5 Left 2 D6 Left 3 D7 Left 4 Some relevant links: http://www.atariage.com/forums/topic/78065-how-to-dump-your-fb2-games/ http://www.atariage.com/forums/index.php?app=blog&module=display§ion=blog&blogid=134&showentry=5561 Edited July 1, 2010 by Wickeycolumbus Quote Link to comment Share on other sites More sharing options...
ibogost Posted July 1, 2010 Author Share Posted July 1, 2010 Thanks, this is a good start. I'll read through these materials and see what I want to do next. Quote Link to comment Share on other sites More sharing options...
yuppicide Posted July 1, 2010 Share Posted July 1, 2010 I always thought it would be nice to trigger the output during a game when something happens.. for example, you can have an adult game that triggers a vibrator to go off when you get certain points, or one of those USB humping dogs that moves. 1 Quote Link to comment Share on other sites More sharing options...
Pioneer4x4 Posted July 2, 2010 Share Posted July 2, 2010 I had my own idea for a game to use it. I started working on it in batari basic, but can't get it to work with limited ram, so I never bothered with the write to port part yet. I have one other idea for indicators of game progress type things I need to test first. Quote Link to comment Share on other sites More sharing options...
Animan Posted August 28, 2010 Share Posted August 28, 2010 Always wanted to hook up two 2600's via there controller ports, and make a game that can have multiplayer over two systems. That would be really cool to do... Quote Link to comment Share on other sites More sharing options...
supercat Posted August 29, 2010 Share Posted August 29, 2010 Port A output has been used in a number of applications, here are some from the top of my head: Reading keypad controllers. The bidirectional ability was used and acknowledged 'back in the day'; I don't know if the keypads were part of the original 2600 design concept, but Atari certainly produced them soon after the 2600 was released. Quote Link to comment Share on other sites More sharing options...
Pioneer4x4 Posted August 30, 2010 Share Posted August 30, 2010 Reading keypad controllers. The bidirectional ability was used and acknowledged 'back in the day'; I don't know if the keypads were part of the original 2600 design concept, but Atari certainly produced them soon after the 2600 was released. Excellent! That is the only way I have figured out how to use them for the project I am working on, you output on 3 pins and read 4 others. Is there any source documentation on how they are used on the console? Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted August 30, 2010 Share Posted August 30, 2010 Reading keypad controllers. The bidirectional ability was used and acknowledged 'back in the day'; I don't know if the keypads were part of the original 2600 design concept, but Atari certainly produced them soon after the 2600 was released. Excellent! That is the only way I have figured out how to use them for the project I am working on, you output on 3 pins and read 4 others. Is there any source documentation on how they are used on the console? How Keyboard controllers are used? From the Stella Programmer's Manual: 5.5 Keyboard controllers The keyboard controller has 12 buttons arranged into 4 rows and 3 columns. A signal is sent to a row, then the columns are checked to see if a button is pushed, then the next row is signaled and all columns sensed, etc. until the entire keyboard is scanned and sensed. The PIA sends the signals to the rows, and the columns are sensed by reading INPT0, INPT1, and INPT4 of the TIA. With Port A configured as an output port, the data bits will send a signal to the keyboard controller rows according to the following table : Data Bit Keyboard Row Player D7 bottom P0 D6 third P0 D5 second P0 D4 top P0 D3 bottom P1 D2 third P1 D1 second P1 D0 top P1 (P0 = left player, P1 = right player) NOTE : a delay of 400 microseconds is necessary between writing to this port and reading the TIA input ports. Quote Link to comment Share on other sites More sharing options...
Pioneer4x4 Posted August 31, 2010 Share Posted August 31, 2010 Reading keypad controllers. The bidirectional ability was used and acknowledged 'back in the day'; I don't know if the keypads were part of the original 2600 design concept, but Atari certainly produced them soon after the 2600 was released. Excellent! That is the only way I have figured out how to use them for the project I am working on, you output on 3 pins and read 4 others. Is there any source documentation on how they are used on the console? How Keyboard controllers are used? From the Stella Programmer's Manual: 5.5 Keyboard controllers The keyboard controller has 12 buttons arranged into 4 rows and 3 columns. A signal is sent to a row, then the columns are checked to see if a button is pushed, then the next row is signaled and all columns sensed, etc. until the entire keyboard is scanned and sensed. The PIA sends the signals to the rows, and the columns are sensed by reading INPT0, INPT1, and INPT4 of the TIA. With Port A configured as an output port, the data bits will send a signal to the keyboard controller rows according to the following table : Data Bit Keyboard Row Player D7 bottom P0 D6 third P0 D5 second P0 D4 top P0 D3 bottom P1 D2 third P1 D1 second P1 D0 top P1 (P0 = left player, P1 = right player) NOTE : a delay of 400 microseconds is necessary between writing to this port and reading the TIA input ports. THANKS!!!!! I was doing it by setting a column to high and reading the rows. The main reason I did it that way was I have more inputs available, maybe I'll try it the other way, it might work better with those damn resistors in the controller. This is what I am working on. Quote Link to comment Share on other sites More sharing options...
Syntaxerror999 Posted November 7, 2010 Share Posted November 7, 2010 (edited) Port A, which is read on SWCHA, is typically used as input to read the P0 and P1 joystick controllers. However, as specified in the Stella Programmers Guide, the port can be set either for input or for output: Port A has an 8 bit wide Data Direction Register (DDR) that is written to at SWACNT (HEX 281) to set each individual pin of Port A to either input or output. The Port A pins are labeled PA0 thru PA7, and writing a "0" to a pins' DDR bit sets that pin as input, and a "1" sets it as an output. For example, writing all 0's to SWACNT (the DDR for Port A) sets PA0 thru PA7 (all 8 pins of Port A) as inputs. If F0 (11110000) were written to SWACNT then PA7, PA6, PA5 & PA4 would be outputs, and PA3, PA2, PA1 & PA0 would be inputs. I'm wondering if anyone has ever used Port A as an output port and communicated with another computer or device from the VCS. If so, what did you do (write a serial communication protocol, for example)? Such a task would also require rigging the two 9-pin joystick ports to act as a DCE device. It's not clear to me how the SWCHA register relates to the 9-pin input device itself, and what sort of hack I'd have to concoct to succeed at transmitting data from the VCS to the foreign computer. At the time the only device that used this feature was the Keyboard controlers. I think a couple later devices (circa 1986) were made that utilized this feature. Imagine what the atari could have done if more companies realized this. they could of even kept the use of two joysticks by making them work like a keyboard controler in one port and their device in the other (hint hint Atarivox designers) Edited November 7, 2010 by Syntaxerror999 Quote Link to comment Share on other sites More sharing options...
+Propane13 Posted November 11, 2010 Share Posted November 11, 2010 I made a 300 baud communication program a long time back that did this. It was called Teleterm 2600. Not much, but it allowed you to have 2 systems communicating with each other via special wire (or even eventually hook it to a computer). No UART required-- it was the genuine RS-232 protocol. Here's the info I dug up about it: http://www.biglist.com/lists/stella/archives/200108/msg00119.html If someone breathed new life into this thing, it would make my day. -John Quote Link to comment Share on other sites More sharing options...
doppel Posted December 3, 2010 Share Posted December 3, 2010 One important detail that keeps getting glossed over is that in order to read the keypad in the right controller port, INPT2, INPT3, and INPT5 are used, not INPT0, INPT1, and INPT4. Quote Link to comment Share on other sites More sharing options...
supercat Posted December 4, 2010 Share Posted December 4, 2010 (edited) One important detail that keeps getting glossed over is that in order to read the keypad in the right controller port, INPT2, INPT3, and INPT5 are used, not INPT0, INPT1, and INPT4. BTW, I'm surprised nobody BITD ever made a 48-key keypad for the 2600. Electrically, it would have required nothing more than two keypad controllers, but it would have allowed Basic Programming, as well as letter and number learning games, to be a lot more practical. Edited December 4, 2010 by supercat Quote Link to comment Share on other sites More sharing options...
Syntaxerror999 Posted April 3, 2011 Share Posted April 3, 2011 I always thought it would be nice to trigger the output during a game when something happens.. for example, you can have an adult game that triggers a vibrator to go off when you get certain points, or one of those USB humping dogs that moves. I like your idea... maybe not for a sex game... that just be weird... but it be good for an atari joystick with rumble feature. Quote Link to comment Share on other sites More sharing options...
player 0ne Posted September 16, 2011 Share Posted September 16, 2011 You could have lights. i think the teleterm idea is really cool. how do you make the connection cable. . Get 2 carts of teleterm. would teeterm fit with other stuff onto a cart? or 1 burned cart and a harmony cart. the teleterm bin looked pretty cool. i am very interested in this stuff. after market atari stuff. non-game uses. Quote Link to comment Share on other sites More sharing options...
+Propane13 Posted September 16, 2011 Share Posted September 16, 2011 From the stella-list post, I have this written: "I can't remember which pin it transfers on, but I made a cable which connected 2 9-pin connectors via pins 1 to 3, 3 to 1, 4 to 2, and 2 to 4, but I made the demo rs232 compliant, so only 2 of those wires should really be useful. To test on itself, take a 9-pin connector and wire pin 1 to 3 and pin 2 to 4." So, that's what you need to do. The ROM is 4K, so can fit with other ROMS on certain media. I believe I tested it back in the day with one burned cart and one via SuperCharger. So, if you have a SuperCharger and a Harmony cart, you have all you need. -John Quote Link to comment Share on other sites More sharing options...
heavyw8bit Posted January 4, 2014 Share Posted January 4, 2014 Sorry for the necrobump. Just wanted to add that I updated Paul Slocum's music driver so that it uses Port A output as a clock out. This video shows how I was able to use the clock out feature to sync the 2600 with the NES using FamiSlayer 3 Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted January 4, 2014 Share Posted January 4, 2014 That's the coolest thing... ever!! Well done. Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted January 5, 2014 Share Posted January 5, 2014 What happens if you run a db9 from an Atari 2600 to a Sega Genesis? That would be interesting to use the Genesis for the RAM, save RAM and ROM storage.. Quote Link to comment Share on other sites More sharing options...
RevEng Posted January 5, 2014 Share Posted January 5, 2014 Just wanted to add that I updated Paul Slocum's music driver so that it uses Port A output as a clock out. So... freaking... cool! Extra style points awarded for the alligator clip connections! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.