Jump to content

Control scheme idea


123 replies to this topic

#18  

    Stargunner

  • 1,403 posts
  • Joined: 15-August 05
  • Location:Beavercreek, Ohio

Posted Thu Mar 1, 2007 7:57 AM

With analog comes calibration....

Which is why the Atari's don't use the full range of the paddle. By picking a conservative range of values, they ensure that the game will be playable on any machine. Your 'offset' is going to be different for each machine.

Don't forget the the capacitors in these machines are 25+ ears old... they are most definitely going to vary!

#19  

    River Patroller

  • 2,899 posts
  • Joined: 05-February 07
  • Location:Phoenix, AZ

Posted Sun Mar 4, 2007 6:30 PM

View Postpoobah, on Thu Mar 1, 2007 6:57 AM, said:

With analog comes calibration....
[...]
Your 'offset' is going to be different for each machine.

Oh, most definitely. This is complicated further by the usable range differing from game to game. I think I have a fairly simple method to make the needed adjustments in an electronic implementation. Of course it often seems easy until it comes time to implement.

In my mechanical implementation, I can't just slop at the ends of the potentiometer rotation as the device has a restricted range of motion and needs to correlate its absolute orientation to the absolute position of the player on the screen. So, I have to control both the centering and the total travel of the potentiometer.

The centering adjustment is done by setting the controller to its physically centered position and centering the player on the screen by rotating the potentiometer housing in its mounting.

The overall range of motion is adjusted by adjusting another part of the mechanism which governs how many degrees the potentiometer rotates relative to the user interface of the controller as it moves through its full range of motion.

The ratio of motion, (potentiometer:mechanical user interface) ranges from 1:1 to theoretically 0:1. But, I doubt that I'll need to ever even approach that 0:1 for actual game play. The finished design may limit that adjustment so as to prevent the appearance that the device isn't working at all. (On the other hand, allowing that 0:1 position would obviate the need to lock the controller in place for the centering portion of the adjustment.)

Because the range of motion of my controller is relatively small, I had to use a higher value potentiometer to match the 1 Megohm delta afforded by the standard ~330 degree paddle controllers.

#20  

    Quadrunner

  • 6,366 posts
  • Joined: 01-June 05

Posted Sun Mar 4, 2007 7:11 PM

BTW, another thing you might consider would be to use fixed-pulse-width period modulation as an alternative to pulse timing. If the port is pulled up with a 1K resistor, 2% of the time, that will be seen by the 2600 as a 50K resistor. To avoid jitter, the high pulse should probably be one microsecond or less. Further, the port should be switched between active high and floating (or else it should drive a transistor that is switched likewise). If these constraints are observed, it should be possible to control things reasonably effectively without having to sync up to the 2600's timing.

#21  

    River Patroller

  • 2,899 posts
  • Joined: 05-February 07
  • Location:Phoenix, AZ

Posted Mon Mar 5, 2007 5:57 AM

View Postsupercat, on Sun Mar 4, 2007 6:11 PM, said:

BTW, another thing you might consider would be to use fixed-pulse-width period modulation as an alternative to pulse timing. If the port is pulled up with a 1K resistor, 2% of the time, that will be seen by the 2600 as a 50K resistor. To avoid jitter, the high pulse should probably be one microsecond or less. Further, the port should be switched between active high and floating (or else it should drive a transistor that is switched likewise). If these constraints are observed, it should be possible to control things reasonably effectively without having to sync up to the 2600's timing.


"fixed-pulse-width period modulation": does that mean that the duty cycle within the pulse remains constant, say 50%, and the period of the waveform is increased and decreased? And that would be in contrast to a constant frequency/period waveform with a variable duty cycle?
Thanks for the one microsecond estimate. I had no clue where a reasonable starting point would be in tinkering with this.

I think we're essentially on the same page, which gives me a whole lot more confidence that such a scheme might actually be workable. :)

To eliminate the jitter issue completely, I would probably need to consider sensing the controller position with an absolute position encoder or an incremental encoder with detection of a "home" position (to keep the system aware of the actual physical position of the controller), whichever is cheaper and/or easier to implement. They're probably becoming more common than potentiometers these days anyway.

#22  

    River Patroller

  • 4,326 posts
  • Joined: 24-January 05
  • Syzygyst
  • Location:U.S.A. - See 'Map' link above

Posted Mon Mar 5, 2007 2:50 PM

View PostBigO, on Mon Mar 5, 2007 3:57 AM, said:

"fixed-pulse-width period modulation"
AKA "pulse frequency modulation" (PFM) instead of pulse width modulation (PWM). PFM duty cycle varies with frequency, but the duration of the "on" pulse is fixed (frequency/duty change is by duration of the "off" period only).

In standard PWM, total cycle time is constant but "on" and "off" times vary inversely.

Edited by A.J. Franzman, Mon Mar 5, 2007 2:59 PM.


#23  

    Quadrunner

  • 6,366 posts
  • Joined: 01-June 05

Posted Mon Mar 5, 2007 6:17 PM

View PostA.J. Franzman, on Mon Mar 5, 2007 2:50 PM, said:

AKA "pulse frequency modulation" (PFM) instead of pulse width modulation (PWM). PFM duty cycle varies with frequency, but the duration of the "on" pulse is fixed (frequency/duty change is by duration of the "off" period only).

In standard PWM, total cycle time is constant but "on" and "off" times vary inversely.

Pulse-period modulation isn't quite the same as frequency modulation.

In pulse-width modulation, if the period is 1ms, values of 10%, 20%, and 30% would be represented by pulse widths of 100us, 200us, and 300us.

In frequency modulation, if the pulse width is 100us, values of 10%, 20%, and 30% would be represented by frequencies of 1kHz, 2kHz, and 3kHz.

Using period modulation, there is no "full-scale" value but rather a non-zero minimum value. If the pulse width is 1us, then values 10x, 20x, and 30x the minimum would correspond to periods of 10us, 20us, and 30us (frequencies of 100kHz, 50kHz, and 33.3kHz).

Period modulation is unusual, but it's called for in this application to achieve a linear control response.

#24  

    Quadrunner

  • 6,366 posts
  • Joined: 01-June 05

Posted Mon Mar 5, 2007 6:29 PM

View PostBigO, on Mon Mar 5, 2007 5:57 AM, said:

To eliminate the jitter issue completely, I would probably need to consider sensing the controller position with an absolute position encoder or an incremental encoder with detection of a "home" position...

Pots are fine, if you know how to use them well.

There are two ways of reading pots: resistance mode, and ratiometric mode. In resistance mode, one end of the pot is left unconnected and the system measures the resistance between the wiper and the other end. In ratiometric mode, a voltage is applied between the two ends of the pot and the system measures the voltage at the wiper.

The biggest cause of jitter in a typical pot is variation in the wiper resistance. When reading pots in resistance mode, the wiper resistance will be added to the measured value; if it's inconsistent, it will cause 'jitter'.

When reading pots in voltage mode, however, if the pot is driving a high-impedance input, wiper resistance is largely a non-factor; its effect can be reduced further by adding a capacitor between the wiper and ground. Adding such a cap to a resistance-mode pot circuit won't help things, but with a voltage-mode circuit it will clean them up very nicely.

My recommendation would be to use a potentiometer in voltage mode and feed the output of the pot into a microcontroller's ADC pin. Depending upon the value of the pot, you might need to add a high-impedance op amp but if you use a 100K or smaller pot you should be fine (don't go below 1K, though).

#25  

    River Patroller

  • 4,326 posts
  • Joined: 24-January 05
  • Syzygyst
  • Location:U.S.A. - See 'Map' link above

Posted Tue Mar 6, 2007 4:27 PM

View Postsupercat, on Mon Mar 5, 2007 4:17 PM, said:

Pulse-period modulation isn't quite the same as frequency modulation.

In frequency modulation, if the pulse width is 100us, values of 10%, 20%, and 30% would be represented by frequencies of 1kHz, 2kHz, and 3kHz.

Using period modulation, there is no "full-scale" value but rather a non-zero minimum value. If the pulse width is 1us, then values 10x, 20x, and 30x the minimum would correspond to periods of 10us, 20us, and 30us (frequencies of 100kHz, 50kHz, and 33.3kHz).

Period modulation is unusual, but it's called for in this application to achieve a linear control response.
Po-tay-to, po-tah-to. Both methods involve a fixed "on" time and variable "off" time -- the difference is in semantics and mathematics. PPM is essentially looking at PFM from a different viewpoint.

But I agree that due to the charging curve of the capacitance, using a PPM-type scheme will probably give the better results.

#26  

    River Patroller

  • 2,899 posts
  • Joined: 05-February 07
  • Location:Phoenix, AZ

Posted Wed Mar 7, 2007 11:19 PM

Thanks, guys, for the great discussion. Yeah, it makes a lot of sense to me that the PPM type scheme would be better at avoiding timing issues.

Good point, supercat, about the two modes of the potentiometer. The Atari paddles use resistance mode. Clearly, they're prone to jitter. I'm always in favor of using the simplest and cheapest possible technology that will get the job done so if pots is it then pots it is.

It occured to me to try a cap to clean up the paddle jitters in the standard controller but couldn't work out in my head what effect this would have on the linearity of the control and I've already cleaned all three of my sets anyway.

#27  

    River Patroller

  • 4,326 posts
  • Joined: 24-January 05
  • Syzygyst
  • Location:U.S.A. - See 'Map' link above

Posted Wed Mar 7, 2007 11:45 PM

View PostBigO, on Wed Mar 7, 2007 9:19 PM, said:

Good point, supercat, about the two modes of the potentiometer. The Atari paddles use resistance mode. Clearly, they're prone to jitter. I'm always in favor of using the simplest and cheapest possible technology that will get the job done so if pots is it then pots it is.

It occured to me to try a cap to clean up the paddle jitters in the standard controller but couldn't work out in my head what effect this would have on the linearity of the control and I've already cleaned all three of my sets anyway.
Been there, done that! What you'd be doing is adding capacitance to a different part of the timing circuit, which already has an existing capacitor inside the console. Not only does this conflict not improve the jitter situation, it makes the effective range of the pot even smaller (maybe a LOT smaller, depending on what capacitance value you use.)

Edited by A.J. Franzman, Wed Mar 7, 2007 11:47 PM.


#28  

    Quadrunner

  • 6,366 posts
  • Joined: 01-June 05

Posted Thu Mar 8, 2007 12:18 AM

[quote name='A.J. Franzman' date='Wed Mar 7, 2007 11:45 PM' post='1252388']It occured to me to try a cap to clean up the paddle jitters in the standard controller but couldn't work out in my head what effect this would have on the linearity of the control and I've already cleaned all three of my sets anyway.[/quote]Been there, done that! What you'd be doing is adding capacitance to a different part of the timing circuit, which already has an existing capacitor inside the console. Not only does this conflict not improve the jitter situation, it makes the effective range of the pot even smaller (maybe a LOT smaller, depending on what capacitance value you use.)[/quote]

In measurement schemes where the voltage on the resistor does not change during a measurements, adding a cap will often reduce jitter without any ill effects. In measurement schemes where the voltage on the resistor is changed during a measurement, adding a cap will often cause bad things to happen and is unlikely to reduce jitter in any case.

What's needed if you want a good jitter-free pot solution is a device with a high-impedance input that can then simulate a variable resistance. A microcontroller producing a pulse-period-modulated signal (that switches between high and floating--not between high and low!) is probably the easiest way to achieve it, though there are ways to produce similar effects with a reasonable number of discrete components.

#29  

    River Patroller

  • 2,899 posts
  • Joined: 05-February 07
  • Location:Phoenix, AZ

Posted Thu Mar 8, 2007 10:34 PM

supercat, switching between zero resistance and hi-z was was one of my earliest inclinations but I thought I'd first try zero resistance and max resistance as that more closely modeled the pot (in my mind anyway).

I reckon though that switching between a short circuit (minimum charge time on the internal cap) and hi-z (cap never charges) would be more effective.
In other words:
switching between [charge-as-fast-as-possible] and [charge-not-at-all]
vs.
switching between [charge-as-fast-as-possible] and [charge-slower-than-as-fast-as-possible]

In terms of the discrete component approach, FET? Or just a reg'lar old transistor switching the connection on and off, driven into/out of saturation by a variable frequency input? I'm not much good with analog stuff, but am definitely up for simpler+cheaper=better.

In my more digitally inclined mind, I want to think tri-state buffer...alternate between hi-z and 0.

Edited by BigO, Sun Aug 12, 2007 9:15 PM.


#30  

    River Patroller

  • 4,326 posts
  • Joined: 24-January 05
  • Syzygyst
  • Location:U.S.A. - See 'Map' link above

Posted Fri Mar 9, 2007 1:10 AM

View PostBigO, on Thu Mar 8, 2007 8:34 PM, said:

supercat, switching between zero resistance and hi-z was was one of my earliest inclinations but I thought I'd first try zero resistance and max resistance as that more closely modeled the pot (in my mind anyway).

I reckon though that switching between a short circuit (minimum charge time on the internal cap) and hi-z (cap never charges) would be more effective.
In other words:
switching between [charge-as-fast-as-possible] and [charge-not-at-all]
vs.
switching between [charge-as-fast-as-possible] and [charge-slower-than-as-fast-as-possible]
If you're not synching up your charge pulses to the console, you will want some resistance in there. Otherwise, sooner or later you're going to be trying to charge the cap at the same time the console is trying to discharge it. If the console has no built-in current limiting this would be effectively connecting +5V directly to ground, which is known to be a Bad Thing and will likely let the magic smoke out of something.

I just measured the lowest resistance (full clockwise) of nine pairs of paddles that I have here, and the single lowest resistance pot measured 35 ohms. Several others measured between 55 and 60, and the rest were all in the range of 60-200 ohms. So, depending on the timing needs of your circuit, I would start with a minimum of a 56 ohm resistor for the "charge" value, and just maybe take it as low as 33 ohms if needed.

Edited by A.J. Franzman, Fri Mar 9, 2007 1:30 AM.


#31  

    Quadrunner

  • 6,366 posts
  • Joined: 01-June 05

Posted Fri Mar 9, 2007 8:25 AM

View PostA.J. Franzman, on Fri Mar 9, 2007 1:10 AM, said:

If you're not synching up your charge pulses to the console, you will want some resistance in there. Otherwise, sooner or later you're going to be trying to charge the cap at the same time the console is trying to discharge it. If the console has no built-in current limiting this would be effectively connecting +5V directly to ground, which is known to be a Bad Thing and will likely let the magic smoke out of something.

The 2600 has a built-in resistor which goes in series with the paddle, so there's no danger of damage there.

The resistor should be selected so that the combination of the resistance in the controller and and one in the console take about 200-400 pulses to charge the cap. If the pulses cannot be made short enough for that to work, some other approach may be required.

#32  

    Dragonstomper

  • 517 posts
  • Joined: 09-July 01
  • Location:Santa Clara, CA

Posted Fri Mar 9, 2007 12:27 PM

View Postsupercat, on Fri Mar 9, 2007 2:25 PM, said:

The 2600 has a built-in resistor which goes in series with the paddle, so there's no danger of damage there.
Be careful...not all 2600's have those resistors. Some of the joystick port pins are directly touching the TIA chip.
It wouldn't be a bad idea to add a small resistor just to be safe.

-Chris

#33  

    River Patroller

  • 2,899 posts
  • Joined: 05-February 07
  • Location:Phoenix, AZ

Posted Fri Mar 9, 2007 3:23 PM

View Postcwilkson, on Fri Mar 9, 2007 11:27 AM, said:

View Postsupercat, on Fri Mar 9, 2007 2:25 PM, said:

The 2600 has a built-in resistor which goes in series with the paddle, so there's no danger of damage there.
Be careful...not all 2600's have those resistors. Some of the joystick port pins are directly touching the TIA chip.
It wouldn't be a bad idea to add a small resistor just to be safe.

-Chris

Ah, I see in the schematics (AtariAge archives) that the CX-2600 does have the resistors and the CX-2600A does not. Good to know. Of all things in a 2600 that I'd want to let the smoke out of, the TIA would be pretty far down my list. There's no protection on those pins in the TIA hardware? It must be considered nearly impossible then for a potentiometer to actually supply a zero resistance.

I note that the Keyboard controller pulls pins 5 and 9 high through 4.7K resistors to pin 7, but shorts 5 or 9 to any one of 1,2,3,4 depending on keypresses. With 5 and 9 both being inputs to the TIA, that would mean that 1,2,3,4 (pa0, 1, 2, 3 of the 6532 RIOT), configured as outputs, are pulsing the rows (or columns, whichever) of the key matrix.

Pressing the * key shorts pin 5 to pin 4. Pin 4 is presumably alternating between 0 and 5 volts. So, when pin 4 is high and I press *, would that effectively be the same as shorting pin 5 to pin 7 in the scenario discussed earlier where pin 7 is supplying 5 volts? Or is the RIOT port not quite that assertive?

I guess it's all academic, really . . . just trying to bolster my gut-level understanding of this animal. I probably should take any deeper discussion over to a separate topic.

(I can say with certainty that my console can withstand a dead short between pins 5 and 7 while playing a paddle game with no ill effects. :ponder:)

Edited by BigO, Fri Mar 9, 2007 5:27 PM.


#34  

    Dragonstomper

  • 517 posts
  • Joined: 09-July 01
  • Location:Santa Clara, CA

Posted Fri Mar 9, 2007 10:25 PM

View PostBigO, on Fri Mar 9, 2007 9:23 PM, said:

Ah, I see in the schematics (AtariAge archives) that the CX-2600 does have the resistors and the CX-2600A does not. Good to know. Of all things in a 2600 that I'd want to let the smoke out of, the TIA would be pretty far down my list. There's no protection on those pins in the TIA hardware? It must be considered nearly impossible then for a potentiometer to actually supply a zero resistance.
IMO, the TIA should be the absolute *LAST* component you want to part from its magic smoke. ;)

No, there's no protection inside the TIA. It's a nice, big healthy transistor on pins 37-40, so it might not blow up. Then again, that might make it *more* likely to explode (/quickly burn out). Being beefy makes it a really strong pull down, with lots of current sinking capability. So it *will* get hot if the software asks that pin to be low for any extended period while it's shorted to VCC. Over time, that could lead to failure.

Quote

Pressing the * key shorts pin 5 to pin 4. Pin 4 is presumably alternating between 0 and 5 volts. So, when pin 4 is high and I press *, would that effectively be the same as shorting pin 5 to pin 7 in the scenario discussed earlier where pin 7 is supplying 5 volts? Or is the RIOT port not quite that assertive?
Couple of things.
First, 4 is shorted to 5 which is connected to pin 7 *through the resistor*. At no time is pin 7 (=VCC) shorted to any other pin through switches. At best, it's connected through two 4.7k resistors in parallel (~2.4k effective). Second, I don't have my data for the RIOT here, but my guess is that the RIOT isn't that beefy. It's an NMOS chip, and it's meant to be driving a bus. So it probably has somewhat weak pullups. (but strong pull downs!)

Quote

(I can say with certainty that my console can withstand a dead short between pins 5 and 7 while playing a paddle game with no ill effects. :ponder:)
GASP! Your poor TIA!!! :_(

-Chris

#35  

    Quadrunner

  • 6,366 posts
  • Joined: 01-June 05

Posted Fri Mar 9, 2007 11:18 PM

View PostBigO, on Fri Mar 9, 2007 3:23 PM, said:

Ah, I see in the schematics (AtariAge archives) that the CX-2600 does have the resistors and the CX-2600A does not.

If there isn't a resistor internal to the 2600, then one will be required externally. Not just to protect the TIA, but also to produce proper operation. The goal of the circuit is to charge the cap about 1/200 of the way with each pulse. With no resistor or other current-limiting circuit, the cap would probably charge too quickly.

If the circuit is supposed to have similar behavior on the 2600 and 2600A, it may be necessary to use a current-limiter circuit instead of a mere resistor. I'd suggest something like this:
.			 +V
.		 ,-R2-+
.		 |	R1
.		 |	|
.		 |	E
.PWM--R3--+---B
.			  C----- Paddle
The transistor should be a small PNP type (2N3904 or equivalent). As a guess, I would suggest R1=100ohm, R2=1K, and adjust R3 as needed. The PWM should be low to charge and high to not charge.

#36  

    River Patroller

  • 2,899 posts
  • Joined: 05-February 07
  • Location:Phoenix, AZ

Posted Sat Mar 10, 2007 12:18 AM

View Postcwilkson, on Fri Mar 9, 2007 9:25 PM, said:

Couple of things.
First, 4 is shorted to 5 which is connected to pin 7 *through the resistor*. At no time is pin 7 (=VCC) shorted to any other pin through switches. At best, it's connected through two 4.7k resistors in parallel (~2.4k effective). Second, I don't have my data for the RIOT here, but my guess is that the RIOT isn't that beefy. It's an NMOS chip, and it's meant to be driving a bus. So it probably has somewhat weak pullups. (but strong pull downs!)

Quote

(I can say with certainty that my console can withstand a dead short between pins 5 and 7 while playing a paddle game with no ill effects. :ponder:)
GASP! Your poor TIA!!! :_(

-Chris

The 5 to 7 short was only in reference to the earlier discussion about the circuitry to emulate a paddle controller, not the keyboard controller scenario.

I was just saying that if the RIOT supplies 5 volts on pin 4 which is shorted to pin 5 via the * key, that might effectively be the same as shorting 5 to 7 in the earlier discussion. But, I guess you must understand that because you addressed that concern regarding the RIOT's pull up capability.

I'm convinced, a current limiting mechanism of some flavor will be in order if I try to emulate the paddle controller signal with active hardware.

I believe the TIA has forgiven me for my miswiring episode as it still permits me to play Circus with my standard paddle controller and with my prototype homebrew potentiometer based controller. :D

#37  

    River Patroller

  • 2,899 posts
  • Joined: 05-February 07
  • Location:Phoenix, AZ

Posted Sat Mar 10, 2007 12:49 AM

View Postsupercat, on Fri Mar 9, 2007 10:18 PM, said:

View PostBigO, on Fri Mar 9, 2007 3:23 PM, said:

Ah, I see in the schematics (AtariAge archives) that the CX-2600 does have the resistors and the CX-2600A does not.

If there isn't a resistor internal to the 2600, then one will be required externally. Not just to protect the TIA, but also to produce proper operation. The goal of the circuit is to charge the cap about 1/200 of the way with each pulse. With no resistor or other current-limiting circuit, the cap would probably charge too quickly.

If the circuit is supposed to have similar behavior on the 2600 and 2600A, it may be necessary to use a current-limiter circuit instead of a mere resistor. I'd suggest something like this:
.			 +V
.		 ,-R2-+
.		 |	R1
.		 |	|
.		 |	E
.PWM--R3--+---B
.			  C----- Paddle
The transistor should be a small PNP type (2N3904 or equivalent). As a guess, I would suggest R1=100ohm, R2=1K, and adjust R3 as needed. The PWM should be low to charge and high to not charge.

Thanks. Duly noted and now available for my future reference. (Thankfully, I won't have to rely solely on my memory.)

Since my circuit will have to have calibration capability anyway to do the centering and physical to screen position correlation, I think that same adjustment should by its nature compensate for the variation in behavior between the two internal resistor scenarios. On that basis, I was thinking a fixed resistor might suffice for protection. The same conventional paddle controllers will work on either 2600 or 2600A so the minimum resistance of the potentiometer itself seems to be sufficient protection for the TIA on the 2600A.

I take it "low to charge" means to apply a suitably small resistance between pins 5,7 and/or 5,9 and "high to not charge" means to leave the 5-7 and 5-9 connection open (or highest possible resistance). I believe I'm track.

Cool. Now all I have to do is finish my mechanical version, write my first game then acquire the necessary equipment to work on this excuse-to-play-with-microcontrollers project...say, since my wife's ~$13K long-arm quilting machine just arrived yesterday, now might be a judicious time to spend a few bucks on my own hobbies. :)

#38  

    River Patroller

  • 2,899 posts
  • Joined: 05-February 07
  • Location:Phoenix, AZ

Posted Tue Mar 13, 2007 12:04 AM

Another, mostly academic thought I had that caused me to look into the internals of the 2600 was related to keypad input.

I thought maybe the two "paddle" inputs in one connector port could be used to create an expanded version of a keypad with more keys. I was thinking of pulsing multiple rows or columns simultaneously, but have each of those simultaneously actuated groups connected through a different valued resistor so that the different, let's say rows, could be discerned by using the same method that the paddle controller scheme uses to determine a potentiometer position.

There are twelve keys in the standard keyboard controller. Eight of those are arranged in two columns of four each. One column is attached to pin 9 and is pulled high through a resistor fed 5 volts by pin 7. Currently, when one of those four keys (2, 5, 8 or 0) is pressed, pin 9 is pulled low when the appropriate row line goes low (Pins 1, 2, 3, 4 of the DB-9).

Instead of the 4700 ohm resistor, I was thinking a 1 meg resistor could be used for the pullup. Then, instead of one button per Row/Column intersection, you could have maybe 5 buttons. One would be the "zero ohm" as currently set up. The other 4 could be of incrementally higher values of a range that would be experimentally determined to produce reliably detectable keypresses on a variety of consoles. As an example, the buttons could use: 100K, 220K, 470K, 680K resistors.

The smallest values possible might be best so that the cap charges quickly. Experimentation would be needed to determine the best values. It might be possible to have more buttons, depending on the reliability of detection across consoles and speed with which the keys could be read.

If I actually some immediate application for this, I'd be inclined to shoot for the 5 per intersection number as a starting point. That'd be what, 44 buttons? Probably better than the keyboard on that Tomy Tutor I had for a while.

One column uses pin 6 of the DB-9 which is a standard digital input so only supports 4 buttons.

Probably reading serial data would be a better keyboard interface. This seemed possible with run-of-the mill 2600 port reading techniques, though also might be really slow.

Like I said, just musing. Haven't tried to work out any kinks or sink the idea entirely. Thought I'd toss it out here in case it was useful to anybody or might spark any actual good ideas for someone.

#39  

    Quadrunner

  • 6,366 posts
  • Joined: 01-June 05

Posted Wed Mar 14, 2007 10:33 PM

View PostBigO, on Tue Mar 13, 2007 1:04 AM, said:

Probably reading serial data would be a better keyboard interface. This seemed possible with run-of-the mill 2600 port reading techniques, though also might be really slow.

Using a small micro, it would be possible to send data to the 2600 at a rate of about 74 cycles/byte:
; Y should equal 128; X should equal the transmission length (last byte index+1).  SWCHA.0 should start out being the opposite state from X.0
lp:
  stx SWCHA ; Trigger micro to start transmission
  nop 0
  dex
lp:
  cpy INPT5
  rol
  cpy INPT5
  rol
  cpy INPT5
  rol
  cpy INPT5
  rol
  cpy INPT5
  rol
  cpy INPT5
  rol
  cpy INPT5
  rol
  cpy INPT5
  rol
  sta buffer,x
  stx SWCHA
  dex
  bpl lp
Not the fastest thing in the world, but entirely reasonable.

#40  

    River Patroller

  • 2,899 posts
  • Joined: 05-February 07
  • Location:Phoenix, AZ

Posted Fri Mar 16, 2007 12:02 PM

View Postsupercat, on Wed Mar 14, 2007 9:33 PM, said:

View PostBigO, on Tue Mar 13, 2007 1:04 AM, said:

Probably reading serial data would be a better keyboard interface. This seemed possible with run-of-the mill 2600 port reading techniques, though also might be really slow.

Using a small micro, it would be possible to send data to the 2600 at a rate of about 74 cycles/byte:
; Y should equal 128; X should equal the transmission length (last byte index+1).  SWCHA.0 should start out being the opposite state from X.0
lp:
  stx SWCHA; Trigger micro to start transmission
  nop 0
  dex
lp:
  cpy INPT5
  rol
  cpy INPT5
  rol
  cpy INPT5
  rol
  cpy INPT5
  rol
  cpy INPT5
  rol
  cpy INPT5
  rol
  cpy INPT5
  rol
  cpy INPT5
  rol
  sta buffer,x
  stx SWCHA
  dex
  bpl lp
Not the fastest thing in the world, but entirely reasonable.


Hmm. Yeah, not so bad. I wonder how the overall time to report a single keypress would compare to my original modified keypad scheme. Reading the modified, passive component keypad would be a lot like reading the two paddle controllers (well, except the pulsing of the rows, and well, I guess it's not quite the same after all).

#41  

    Combat Commando

  • 3 posts
  • Joined: 05-April 07

Posted Fri Apr 6, 2007 6:49 PM

...has anyone progressed further with using PWM/PFM/PPM to simulate a paddle? I was thinking a nice solution would be to use a 556 timer (or two 555 timers) as outlined in the attached PDF to generate PWM from a variable voltage - what do you think? what value resistor and capacitor would work best? (the only thing I'm not sure about is just how variable the voltage could be - looking at spec sheets, the control voltage pin on 555/556's seem to offer a very narrow range) thanks for any ideas!

Attached Files


Edited by Grover, Fri Apr 6, 2007 6:50 PM.


#42  

    Quadrunner

  • 6,366 posts
  • Joined: 01-June 05

Posted Fri Apr 6, 2007 8:44 PM

View Postcwilkson, on Fri Mar 9, 2007 11:25 PM, said:

It's an NMOS chip, and it's meant to be driving a bus. So it probably has somewhat weak pullups. (but strong pull downs!)

Speaking of NMOS, I do know that the 6507 most emphatically does not like having a CMOS chip trying to force an address pin high (oops). My poor 2600jr needs a new 6507 since the one that's in there won't let A7 rise above about a volt. Even adding a pullup resistor to it won't help.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users