hex65000 Posted February 2, 2008 Share Posted February 2, 2008 It's been a long time since I've appeared on AA, and I have a question about the 5200 sticks and Pete's Test cart... Okay, the pots are rated to be 500k that's pretty clear. However, when I pop in Pete's test cart, it does not report 255 for the max value when I move my stick in a direction. So, I got out my meter and measured it. In one case I was approaching 600k and still not hitting the max value. My next step was to use a 1Meg pot and ratchet up the resistance until the 5200 reported a 255 and measured that final value. I wound up with around 750k. Yes resistances were measured out of circuit. Since I only have one 5200 deck, I don't know if this is a real result or not. There is the dot display on the test cart that has a box on the screen. is that some kind of agreed upon boundary where a direction occurs? I can still play games just fine on my machine, but I'd like to be able to explain this discrepancy. Are other folks getting similar results or is the inferred boundary the real limit that says a direction has been determined by the system? Hex. [ Button fly on the wall... ] Quote Link to comment Share on other sites More sharing options...
kenfused Posted February 3, 2008 Share Posted February 3, 2008 It's been a long time since I've appeared on AA, and I have a question about the 5200 sticks and Pete's Test cart... Okay, the pots are rated to be 500k that's pretty clear. However, when I pop in Pete's test cart, it does not report 255 for the max value when I move my stick in a direction. So, I got out my meter and measured it. In one case I was approaching 600k and still not hitting the max value. My next step was to use a 1Meg pot and ratchet up the resistance until the 5200 reported a 255 and measured that final value. I wound up with around 750k. Yes resistances were measured out of circuit. Since I only have one 5200 deck, I don't know if this is a real result or not. There is the dot display on the test cart that has a box on the screen. is that some kind of agreed upon boundary where a direction occurs? I can still play games just fine on my machine, but I'd like to be able to explain this discrepancy. Are other folks getting similar results or is the inferred boundary the real limit that says a direction has been determined by the system? Hex. [ Button fly on the wall... ] I always thought (at least on the computers) 228 was the max value you could get. Quote Link to comment Share on other sites More sharing options...
hex65000 Posted February 3, 2008 Author Share Posted February 3, 2008 Your'e right! That's what I get for relying on my memory for stuff like this. I collected some data and have concluded I'm going to need some kind of 10-turn pot to get any stable data results. Still, when 500k is presented, I'll see a value of 175. around 670k puts me at the 228 value. So back to my original question: does the 5200 have to see the Max/Min values to determine that a direction has been pressed, or is it software dependent, or is it 78 to 170 (x-axis) and 50 to 184 (y-axis)? Those values are based on being just outside the blue box found in the testcart stick application. Hex. [ "At last we shall expose ourselves to the Jedi! " --Darth Baio; Goats ] Quote Link to comment Share on other sites More sharing options...
BigO Posted February 3, 2008 Share Posted February 3, 2008 I haven't had to mess with it yet, but there's a centering adjustment of some sort in the 5200 console. Maybe that needs adjustment. There's a full 5200 field service manual in PDF format that you should be able to find with a quick internet search. If you can't find it, ask here. There are plenty of people who can point you there, including me if I take a few minutes to locate it. There's probably alignment procedures in there. The software has to be interpreting the values reported to it by the hardware without requiring that it see either the min or the max possible value. I've seen that some games appear to be self-calibrating in that the player starts off not being centered, but after full range actuation of the controller, it centers itself up. I can't make a completely confident statement about the self-calibration as I didn't bother to follow up on the observation. I can't remember which games do this as I noticed it while developing a custom controller, not while actually intently playing the games. I wouldn't expect many games to rely on receiving the absolute complete, theoretically possible delta from the pots. That sort of accuracy would be tricky to achieve given the variation from capacitor to capacitor. (A capacitor is at the heart of the Analog to Digital scheme used by the 5200 if I understand correctly). I have for a while now theorized that the joysticks on the 5200 are not self-centering because of the additional expense of adding a centering adjustment on the controller or bringing the console-resident adjustment out to a user accesible control or using a different analog to digital conversion method. Maybe a competent 5200 programmer or hardware guru will come along and either confirm or shoot my theories full of holes. Quote Link to comment Share on other sites More sharing options...
Charlie_ Posted February 4, 2008 Share Posted February 4, 2008 I think it is dependant on the software. I know of one game, Haunted House 3D, where the player cant go right or down on a properly calibrated 5200. It is how the software was written I've been told. Funny thing is, it works fine with a Masterplay.... go figure. Quote Link to comment Share on other sites More sharing options...
hex65000 Posted February 5, 2008 Author Share Posted February 5, 2008 Hrm... I think I'm going to have to make a 'design decision' and hope for the best. That is going to relate to where that offset pot lives on the 5200. If it's too hard to get at for the average joe, I'm going to base my plans on what data I collect for my own machine. If I manage to pull this together, it will be rather cool... Hex. [ Wants to go back to blowing up dreadnaughts... ] Quote Link to comment Share on other sites More sharing options...
hex65000 Posted March 5, 2008 Author Share Posted March 5, 2008 " Rise from your grave... " --Altered Beast I just didn't want to start a new thread on a 'similar but different' topic, so anyway... I'm happily working on my plans for my 5200 when I realize a simple question regarding the controllers, specifically, how often does the 5200 go through the process of translating the presented resistance from a joystick axis to a numeric value. I'm guessing it doesn't poll very quickly, but can anyone point me at any specifics or clues on where to start digging for that information? It may be an odd request, but it is important for my project. Hex. [ Is about four milestones away from schedule... curse you real life! ] Quote Link to comment Share on other sites More sharing options...
BigO Posted March 5, 2008 Share Posted March 5, 2008 (edited) " Rise from your grave... " --Altered Beast I just didn't want to start a new thread on a 'similar but different' topic, so anyway... I'm happily working on my plans for my 5200 when I realize a simple question regarding the controllers, specifically, how often does the 5200 go through the process of translating the presented resistance from a joystick axis to a numeric value. I'm guessing it doesn't poll very quickly, but can anyone point me at any specifics or clues on where to start digging for that information? It may be an odd request, but it is important for my project. Hex. [ Is about four milestones away from schedule... curse you real life! ] I can speak in generalities, based on some reading. Inside the console, attached to the POKEY chip, there are capacitors that are charged by the current that passes through the potentiometers in the joysticks. A circuit discharges the capacitor, the capacitor charges at a rate defined by the position (resistance/current limitation) of the potentiometer, a timer (counter) monitors how long it takes the capacitor to charge to a certain level. The terminal value of the counter correlates to a potentiometer position. That position is then translated to a player position by the software. A higher resistance setting on the potentiometer (slower charge time) moves the player to the right or down. A low resistance (fast charge time) moves the player to the left or up. What I don't know, and was about to research, is whether the POKEY must be instructed by software when to begin the Analog to Digital conversion cycle. Based on some behavior I saw while experimenting with a custom controller on various games, it looks like the software can cause the discharge portion of the cycle to remain low as long as it wants to before releasing it to begin the charge/count cycle. I'll have to go back and put a 'scope to it and find out if nobody happens to know the answer. This answer might well be found in a 5200 programming tutorial or example. I haven't looked into that yet. Directly responding to your question, what I've observed would mean that the "polling rate" is variable, i.e. the software is controlling how often the controller is queried for it's x and y positions. The amount of time it takes for each charge cycle to complete will vary based on the position of the potentiometer as this is the heart of the method of Analog to Digital conversion being used. Edited March 6, 2008 by BigO Quote Link to comment Share on other sites More sharing options...
Urchlay Posted March 6, 2008 Share Posted March 6, 2008 What I don't know, and was about to research, is whether the POKEY must be instructed by software when to begin the Analog to Digital conversion cycle. Based on some behavior I saw while experimenting with a custom controller on various games, it looks like the software can cause the discharge portion of the cycle to remain low as long as it wants to before releasing it to begin the charge/count cycle. I'll have to go back and put a 'scope to it and find out if nobody happens to know the answer. This answer might well be found in a 5200 programming tutorial or example. I haven't looked into that yet. If it's like the 8-bit Atari, software *can* control when the polling starts, but usually doesn't: the default VBI handler in the OS ROM does it, and (on 8-bit) you'd have to disable or replace the ROM routine... I've got no idea whether this is really the case on the 5200 (it has an OS, but I don't know everything it does), and if so, whether most games use the OS or their own pot scanning routines... If you google a bit, you can find a disassembly of the 5200 OS (called 5200BIOS.TXT) that might help answer the question. I do know the 5200 has shadows of the POKEY pot addresses, which leads me to believe the OS does pot scanning by default... Quote Link to comment Share on other sites More sharing options...
atariksi Posted March 12, 2008 Share Posted March 12, 2008 " Rise from your grave... " --Altered Beast I just didn't want to start a new thread on a 'similar but different' topic, so anyway... I'm happily working on my plans for my 5200 when I realize a simple question regarding the controllers, specifically, how often does the 5200 go through the process of translating the presented resistance from a joystick axis to a numeric value. I'm guessing it doesn't poll very quickly, but can anyone point me at any specifics or clues on where to start digging for that information? It may be an odd request, but it is important for my project. Hex. [ Is about four milestones away from schedule... curse you real life! ] I can speak in generalities, based on some reading. Inside the console, attached to the POKEY chip, there are capacitors that are charged by the current that passes through the potentiometers in the joysticks. A circuit discharges the capacitor, the capacitor charges at a rate defined by the position (resistance/current limitation) of the potentiometer, a timer (counter) monitors how long it takes the capacitor to charge to a certain level. The terminal value of the counter correlates to a potentiometer position. That position is then translated to a player position by the software. A higher resistance setting on the potentiometer (slower charge time) moves the player to the right or down. A low resistance (fast charge time) moves the player to the left or up. What I don't know, and was about to research, is whether the POKEY must be instructed by software when to begin the Analog to Digital conversion cycle. Based on some behavior I saw while experimenting with a custom controller on various games, it looks like the software can cause the discharge portion of the cycle to remain low as long as it wants to before releasing it to begin the charge/count cycle. I'll have to go back and put a 'scope to it and find out if nobody happens to know the answer. This answer might well be found in a 5200 programming tutorial or example. I haven't looked into that yet. Directly responding to your question, what I've observed would mean that the "polling rate" is variable, i.e. the software is controlling how often the controller is queried for it's x and y positions. The amount of time it takes for each charge cycle to complete will vary based on the position of the potentiometer as this is the heart of the method of Analog to Digital conversion being used. You can poll the pots or have it done by the hardware (so software does not waste CPU time). It's the same POKEY chip on the Atari 800 but memory mapped to location $E800 instead of $D200. Here's a BASIC program for Atari 400/800/XL/XE that will poll the pots: 1 POKE 54286,0 :Stop the OS VBI from interfering 10 POKE 53771,0 :REM Start the scanning 20 IF PEEK(53768)<>0 THEN 20 30 ? PEEK(53760),PEEK(53761) :REM 53760..53767 are the 8 pots on the POKEY chip 40 GOTO 10 This program waits up to 228 scan lines for the scanning to complete. Using VBI (vertical blanking interrupt) allows you to bypass the polling. There's also a fast pot scan mode (set via register at 53775) that does the polling in 2 scan lines but not good for getting a range of accurate values. You should also know that the resistance is inverted on the Atari 800 verses the Atari 5200 (228...0 verses 0..228) but that has to do with the wiring of the potentiometer not the POKEY chip. You could even use your own timer IRQ to time the pots and get a range other than 0..228. 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.