Jump to content
IGNORED

IO Pins for the 5200?


flickertail

Recommended Posts

3 hours ago, flickertail said:

Does the 5200 have IO pins the controller ports the way that the 2600/7800 systems do?

It has I/O pins, but the controllers on the 5200 are analogue, not digital like on the 2600 or 7800.

 

Would you mind rephrasing the question?  I'm not certain that the answer I gave matches what you're looking to find out.

Link to comment
Share on other sites

32 minutes ago, flickertail said:

Is there a way to due I/O through the 5200 controller ports?

That might be difficult or even impossible on a stock 5200.  Without the PIA chip that the A8 range had, it's hard to see how data could be written to the joystick ports since there's no good way to set whether a pin on the port is being used for input or output.

 

Having said that, there may be some way to do it that I'm unaware of, but it doesn't seem feasible at first glance.

 

What are you looking to accomplish?

Link to comment
Share on other sites

23 minutes ago, x=usr(1536) said:

What are you looking to accomplish?

I've been experimenting with a prototype USB interface for Atari VCS Classic and Modern controllers for use with 2600/5200/7800 systems.

 

See video of working demo here.

 

Using the 2600/7800 I/O pins, I figure I could implement a rumble motor feature for the Classic and Modern controllers future 2600/7800 Homebrews. I was just thought it might be possible for 5200 homebrews as well, assuming that the 5200 controller ports support I/O.

  • Like 1
Link to comment
Share on other sites

The i/o pins can't be configured like the 2600/7800/A8 but I don't know if you could make use of the POT common line?

 

This is controlled by software and is normally enabled at initialisation and never touched again. As far as I know the only reason for it to be software controllable is for trak-ball detection; if you read the POTs without enabling POT common you get different values from a joystick and a trak-ball.

 

You usually read the joystick once per frame. You read the POTn registers and store their values in RAM. You then write to POTGO to start another POKEY POT scan.

 

I wonder if disabling POT common for a few cycles then enabling it before writing to POTGO could be used to signal a rumble request? I don't think this would affect a standard joystick as POT common is enabled before the POKEY POT scan is started. With your USB interface, if you can trigger an interrupt on the POT common line, then when you see it go from high to low that is a rumble request.

 

 

  • Like 2
Link to comment
Share on other sites

16 hours ago, playsoft said:

I wonder if disabling POT common for a few cycles then enabling it before writing to POTGO could be used to signal a rumble request? I don't think this would affect a standard joystick as POT common is enabled before the POKEY POT scan is started. With your USB interface, if you can trigger an interrupt on the POT common line, then when you see it go from high to low that is a rumble request.

Hmm... I'd have to give this some thought. On the 2600/7800 implementation, I use the pot common line, Pin 7, to power the Pico and maybe the Classic/Modern controller over the USB... in addition, Pin 7 is also used for the paddle input... Pin 7 does a lot. I had assumed that Pin 9 acts in a similar manner.

 

I tried powering the Pico in a similar manner over Pin 9 that last night on my 4-port 5200, and got disastrous results. I was thinking it was an Amp issue of some kind as there was 5V coming out the 5200 Pin 9 when I checked it with a multi-meter. To be honest, I don't know the specs of the 5200 as well as I do the 2600/7800, so it could be how the 5200 is handling Pin 9 (as you described above) that is the problem.

 

Anyway, that will likely mean I have to provide external battery power of some kind, which is not a big deal to me other than the additional cost to build. That said, running on external power, would free up the 9 pin. Syncing things with the cart might be kinda tricky, so I'll have to mull it over as to how that might be done. This may be especially true if the cart is also trying to figure out if a trackball is attached.

 

Routing Pin to a GPIO pin and then toggling a rumble on/off every time the GPIO goes low would be a reasonable way to do the interrupt.

 

It might be a good idea for me to learn more details on how the trackball works and how the cart does this detection... maybe I can look for this pattern in my C code... so it could be handled correctly. Is there a reasonably understandable description of these online that a 5200 noob like me could understand?

 

Slightly Off-topic - Is there a more reliable power source on the controller port? It would be nice to not have to use an external power source.

 

The max power draw for the Pico is 100mA, with an ideal voltage input of 5V. The controllers might be running in-self powered mode when connected to the Pico, but I can't really tell. When I tried it with the 5200 last night, the controller was blinking like it couldn't get enough power, so maybe it was trying to pull from the Pico... but then I am not really sure.

Edited by flickertail
Link to comment
Share on other sites

17 minutes ago, jsoper said:

EDIT: moved to other thread.

I read your post on the other thread about the 12 pin. I thought he 12 pin just dead. It's good to know that the track pad uses it. I've been using a 15 wire cable for my test, so I stopped using the 9 pin for power, and now I'm using the 12 Pin for power. The PI turned on, and the controller looked to be fired up as well.

 

Unfortunately, it still didn't seem to control the game... but I'm sure I just made a programming mistake. It'll just take some troubleshooting to straighten it out.

Link to comment
Share on other sites

There's a good description of the 5200 controller ports pinout here:

 

https://old.pinouts.ru/InputCables/JoystickAtari5200_pinout.shtml

 

Edit, note this part:

 

Quote

The analog joystick is very much like having a pair of paddles, one each for horizontal and vertical coordinates. The difference is that while paddles use the 5V source for the common voltage, the 5200 analog stick has its own dedicated pin. This is because the stick has a definite center, while the paddles do not. To get consistent behavior with any combination of individual stick and individual console, they could have put trimmers on the stick so the user can adjust the center position. Instead of making each stick adjustable to suit the console, they gave the pots a tightly regulated voltage that"s adjustable within the console. That"s what the tiny little trimmer hanging out near the power on/off switch does. Not that big one; that"s for adjusting the color phase delay.

 

Link to comment
Share on other sites

There is a trak-ball guide here:

 

https://atariage.com/forums/topic/125406-8-bit-conversions/?do=findComment&comment=3306094

 

The second paragraph under Hardware Configuration is saying that when Pot common is disabled the trak-ball returns stationary values which should be in the range $69..$7C.

 

If you read a standard 5200 controller with Pot common disabled you will get a value of $E4, so that's how games can automatically detect the presence of a trak-ball.

 

Edit, this is what Pole Position does:

    6011: A9 00             LDA #$00
    6013: 8D 1F C0          STA CONSOL
    6016: A5 11             LDA $11
    6018: C9 E4             CMP #$E4
    601A: F0 04             BEQ $6020

Clearing bit 2 of CONSOL disables Pot common and $11 is the shadow variable for POT0.

 

However the code isn't quite right, it should write to CONSOL and then wait a couple of frames for the VBI to actually read the POTs. It gets away with it on a real cart but needed a hack to work from the Atarimax Ultimate SD where the menu program has previously enabled POT common.

Link to comment
Share on other sites

2 hours ago, flickertail said:

I read your post on the other thread about the 12 pin. I thought he 12 pin just dead. It's good to know that the track pad uses it. I've been using a 15 wire cable for my test, so I stopped using the 9 pin for power, and now I'm using the 12 Pin for power. The PI turned on, and the controller looked to be fired up as well.

 

Unfortunately, it still didn't seem to control the game... but I'm sure I just made a programming mistake. It'll just take some troubleshooting to straighten it out.

It's probably not the case, but if you use pin 12 for power AND to drive the POT lines then they won't read as $E4 when POT common is disabled (then if the game you are testing does Trak-ball detection it might think you are using one).

Link to comment
Share on other sites

8 hours ago, playsoft said:

There's a good description of the 5200 controller ports pinout here:

...

The analog joystick is very much like having a pair of paddles, one each for horizontal and vertical coordinates.

You can even connect a 2600 paddle to the 5200 horizontal and common lines to play Kaboom, Breakout and such.  The movement is reversed though, so you'll have to open the paddle and move the wire over to the other pot terminal (or install a small switch to support both consoles).

Edited by jsoper
Link to comment
Share on other sites

Another interesting idea might be to bring analog joysticks to the 2600/A8/7800. It could drive the POT lines like it would with the 5200 (but using +5V and trimmers) and map 5 buttons to the joystick directions and trigger inputs. The 5200 games which make use of analog input could be ported to the A8 and retain analog control.

Link to comment
Share on other sites

On 12/3/2021 at 6:12 AM, playsoft said:

Another interesting idea might be to bring analog joysticks to the 2600/A8/7800. It could drive the POT lines like it would with the 5200 (but using +5V and trimmers) and map 5 buttons to the joystick directions and trigger inputs. The 5200 games which make use of analog input could be ported to the A8 and retain analog control.

Thanks for all this info. I've been out of town for work, so I haven't been able to respond. I'll play around with things and see where it goes.

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...