Petscii Forums "PETSCII.COM"
« paddle? »

Welcome Guest. Please Login or Register.
Jul 30, 2010, 10:57pm




Petscii Forums "PETSCII.COM" :: General :: DTVHacking :: paddle?
Page 1 of 2 » Jump to page   Go    [Search This Thread][Send Topic To Friend] [Print]
 AuthorTopic: paddle? (Read 842 times)
gonzo
Newbie
*
member is offline





Joined: Apr 2007
Posts: 5
 paddle?
« Thread Started on Apr 3, 2007, 3:18am »

Hello, I've been reading the Hummer DTV FAQ at:

http://home.earthlink.net/~dgdtv/dtv/data/hummer_faq.html

...and I have a few questions of my own!

1. I read this, "the 'paddle' circuit on the Hummer is radically different from the paddle section in the DTV Rev 2 schematic" - but I thought that the Hummer was the only DTV that was able to use a paddle?

2. I also read that the Hummer's paddle ADC is equivalent to a Sonix SNAD01C - the SNAD01C has an ADC input voltage range of 0V to Vcc, so on the DTV that would be 0V to 3.3V, right? It is possible to potentially extend the SNAD01C ADC input range all the way up to 5.25V, but is it possible to directly power it separately to do this?

3. I've also noticed that the Hummer paddle potentiometer is wired as a voltage divider, rather than as a variable resistor like standard Commodore paddles. I've asked in more than one place, but noone seems to be able to give me a simple straight answer - what is the actual difference in the wiper (output) signal between a variable resistor and a voltage divider? is it just that a variable resistor will never reach 0V, or is there more to it? thanks!
Link to Post - Back to Top  IP: Logged
gmoon
Wizard's Apprentice
*****
member is offline

[avatar]


[homepage]

Joined: Mar 2006
Gender: Male
Posts: 876
Location: Ohio, USA
 Re: paddle?
« Reply #1 on Apr 3, 2007, 7:44am »

I believe the developers were attempting paddle emulation in a similar fashion as the SID (using the same addressing, also), but encountered problems and didn't have time to fix it. So they slapped the ADC on the board (maybe the manuf also made the ADC?) Robin, you can correct this if it's wrong....

Yes, the ADC input range is 0-3.3v. You can scale your input with a voltage divider--just make the output (center of the divider) @ max V equal to 3.3v. We had a pretty good discussion about the subject here:
http://jledger.proboards19.com/index.cgi....read=1148043705

On the original C64, the pot charged a capacitor at a rate proportional to the resistance. The SID tracked the time it took the cap to discharge.

There's a lot more overhead with the ADC, but it should be more accurate than the original schema.

'Course, it's not much good for any original paddle games....
« Last Edit: Apr 6, 2007, 7:49am by gmoon »Link to Post - Back to Top  IP: Logged
David Murray
Moderator
*****
member is offline

[avatar]


[homepage]

Joined: Dec 2004
Gender: Male
Posts: 1,565
Location: Kennedale, TX
 Re: paddle?
« Reply #2 on Apr 3, 2007, 8:26am »


Quote:

Yes, the ADC input range is 0-3.3v. You can scale your input with a voltage divider--just make the output (center of the divider) equal to 3.3v.


I can attest to this.. With Gmoon's help I was able to build a volt-meter, so to speak, that measured voltage anywhere between 0 and 14V using the built in ADC in the hummer.
Link to Post - Back to Top  IP: Logged
Robin Harbron
Moderator
*****
member is offline

[avatar]



Joined: Dec 2004
Gender: Male
Posts: 258
Location: Thunder Bay, Canada
 Re: paddle?
« Reply #3 on Apr 3, 2007, 10:42am »


Quote:
I believe the developers were attempting paddle emulation in a similar fashion as the SID (using the same addressing, also), but encountered problems and didn't have time to fix it. So they slapped the ADC on the board (maybe the manuf also made the ADC?) Robin, you can correct this if it's wrong....

Yes, for a good portion of development we were using a SID paddle register, but we found it was returning erratic values. Quite a bit of jitter (maybe +/- 4 values) and then every so often it would throw out a number that was way off.

We tried coding around it for a while, like, taking averages, and throwing out values that didn't seem right, but it wasn't enough. Eventually they decided to give up on the built-in ADC and go with an external one; I think they had sourced a clone of the Sonix part for 19 cents each, or something.

At first they expected me to blindly modify the game to use this new part, with no actual hardware to test on! Production was being held up by this point, so they were getting desperate, but I managed to convince them to send me the part. Of course, it was up to me to figure out how to interface the thing to my dev. board, and I am *not* a h/w guy... but there I was, soldering away, and then coding for it with no clue if I had it hooked up right, all the while being called from the manufacturing plant in HK if it was working yet...

When I finally got some data coming back from the part, I thought it was the greatest accomplishment of my life to that point... pretty sad, eh? :)
Link to Post - Back to Top  IP: Logged
gmoon
Wizard's Apprentice
*****
member is offline

[avatar]


[homepage]

Joined: Mar 2006
Gender: Male
Posts: 876
Location: Ohio, USA
 Re: paddle?
« Reply #4 on Apr 3, 2007, 12:22pm »


Quote:
At first they expected me to blindly modify the game to use this new part, with no actual hardware to test on! Production was being held up by this point, so they were getting desperate, but I managed to convince them to send me the part. Of course, it was up to me to figure out how to interface the thing to my dev. board, and I am *not* a h/w guy... but there I was, soldering away, and then coding for it with no clue if I had it hooked up right, all the while being called from the manufacturing plant in HK if it was working yet...

So, Robin...is it too much to say you made the decision to utilize the userport? ;) (I know there were only so many options....)

It actually says a lot about the hardware--that's a pretty radical last-minute change.
Link to Post - Back to Top  IP: Logged
Robin Harbron
Moderator
*****
member is offline

[avatar]



Joined: Dec 2004
Gender: Male
Posts: 258
Location: Thunder Bay, Canada
 Re: paddle?
« Reply #5 on Apr 3, 2007, 12:51pm »


Quote:
So, Robin...is it too much to say you made the decision to utilize the userport? ;) (I know there were only so many options....)

I think it was Jeri's idea, I just got to decide what order they were hooked up in :) Jeri was already having strained relationships with some of the parties involved in this by that point, but thankfully was still willing to talk with us since we knew her IRL too.
Link to Post - Back to Top  IP: Logged
gonzo
Newbie
*
member is offline





Joined: Apr 2007
Posts: 5
 Re: paddle?
« Reply #6 on Apr 5, 2007, 6:56am »

thanks guys! I'm still unsure about my question number 1. though, do any of the other DTV models support paddles?


Quote:
We had a pretty good discussion about the subject here:
http://jledger.proboards19.com/index.cgi....read=1148043705


thanks, good reading! I think I've found the answer to my question number 3. then, the difference between a potentiometer wired as a variable resistor or a voltage divider is that a variable resistor only attenuates current, not voltage - correct?


Quote:
On the original C64, the pot charged a capacitor at a rate proportional to the resistance. The SID tracked the time it took the cap to charge.


so, the SID's ADC is not really a true 'ADC' at all, just a timer?!
Link to Post - Back to Top  IP: Logged
gmoon
Wizard's Apprentice
*****
member is offline

[avatar]


[homepage]

Joined: Mar 2006
Gender: Male
Posts: 876
Location: Ohio, USA
 Re: paddle?
« Reply #7 on Apr 5, 2007, 7:47am »


Quote:
thanks, good reading! I think I've found the answer to my question number 3. then, the difference between a potentiometer wired as a variable resistor or a voltage divider is that a variable resistor only attenuates current, not voltage - correct?

For a single resistor (variable or not), that's accurate.


Quote:
so, the SID's ADC is not really a true 'ADC' at all, just a timer?!

Not really--anything that converts analog to digital IS an ADC. There weren't that many cheap approaches when the SID was designed, and this was a standard one.

From the SID Homepage :


Quote:
POTX, POTY (Pins 24, 23)

These pins are inputs to the A/D converters used to digitize the position of potentiometers. The conversion process is based on the time constant of a capacitor tied from the POT pin to ground, charged by a potentiometer tied from the POT pin to +5 volts. The component values are determined by:

R*C = 4.7E-4

Where R is the maximum resistance of the pot and C is the capacitor. The larger the capacitor, the smaller the POT value jitter. The recommended values for R and C are 470 kOhm and 1000 pF. Note that a separate pot and cap are required for each POT pin.


And


Quote:
POTX (Register $19)

This register allows the microprocessor to read the position of the potentiometer tied to POTX (pin 24), with values ranging from 0 at minimum resistance, to 255 ($FF) at maximum resistance. See the Pin Description section for information on pot and capacitor values.[This register is supposed to be updated every 512 cycles].


At 1mHz, I figure that's a sample rate of just under 2kHz...The SNAD01C has ~25kHz rate (but you'd never be able to fetch the data quick enough to reach that rate.)



[edit]Oh, yeah--No, I think the Hummer is the only one with an ADC. I imagine the SID-style ADC is still on the V2/V3 ASIC (line 58, from schematic), but isn't broken-out.
« Last Edit: Apr 5, 2007, 8:17am by gmoon »Link to Post - Back to Top  IP: Logged
gonzo
Newbie
*
member is offline





Joined: Apr 2007
Posts: 5
 Re: paddle?
« Reply #8 on Apr 5, 2007, 8:23am »

great, thank you!

still trying to find an answer to question 1. though, I had a look at http://picobay.com/dtv_wiki/images/b/b0/DTV-Ver2-Schematic.pdf and I see that the Paddle line is on pin 58, and the steering wheel circuit looks as if it is wired as a voltage divider, not a variable resistor. I'm assuming that pin 58 isn't accessible on any DTV boards? And even if it was, standard Commodore paddles wouldn't work without wiring their unconnected potentiometer terminal to ground?

[edit] oh, and I just saw your edit after I posted my reply :)
« Last Edit: Apr 5, 2007, 8:24am by gonzo »Link to Post - Back to Top  IP: Logged
gmoon
Wizard's Apprentice
*****
member is offline

[avatar]


[homepage]

Joined: Mar 2006
Gender: Male
Posts: 876
Location: Ohio, USA
 Re: paddle?
« Reply #9 on Apr 5, 2007, 8:34am »

Heh heh, yeah.

If the schematic is accurate, I'd guess that pin 58 is bi-directional (with no pullup.) They charge the cap with an pulse, then switch to input and wait for the cap to discharge. I can't speculate beyond that--leave that to an EE.
Link to Post - Back to Top  IP: Logged
gonzo
Newbie
*
member is offline





Joined: Apr 2007
Posts: 5
 Re: paddle?
« Reply #10 on Apr 5, 2007, 9:16am »

I'm no expert either, but I've been doing a lot of reading about potentiometers lately, and the one in that schematic looks to me like it is wired as a voltage divider to output to an ADC, not as a variable resistor to charge a capacitor. I think the capacitor between the wiper and ground is only there to reduce jitter (see http://www.atariage.com/forums/index.php....dpost&p=1250857)
Link to Post - Back to Top  IP: Logged
gmoon
Wizard's Apprentice
*****
member is offline

[avatar]


[homepage]

Joined: Mar 2006
Gender: Male
Posts: 876
Location: Ohio, USA
 Re: paddle?
« Reply #11 on Apr 5, 2007, 9:25am »


Quote:
I'm no expert either, but I've been doing a lot of reading about potentiometers lately, and the one in that schematic looks to me like it is wired as a voltage divider to output to an ADC, not as a variable resistor to charge a capacitor.

The only problem is that the opposite end of the POT isn't wired to Vcc, but to the same pin that's tasked to sense the voltage. It can't do both simultaneously--supply voltage for the divider and read the result.

Again--depends on the accuracy of the schematic (there certainly are some differences between those schems & the actual board.)

(Also depends on the capabilities of the ASIC--tracking a pin state vs. time is pretty easy.)

[edit]
On second thought, it would be possible with an internal pullup for this circuit to work as a voltage divider. It just seems like an odd way of doing it.

Unless the ASIC has functional ADC blocks, they'd need to build one internally from scratch--and we've already described the simplest type. Given the problems they encountered, it still seems like a discharge/time approach.

If you're right, the decoupling cap was boxed out with the POT so it be connected externally. If that's not the case--the cap and POT are boxed out since they didn't know which cap/POT combination was cheapest, and both could be eliminated if not needed. All speculation, at this point.
« Last Edit: Apr 5, 2007, 10:20am by gmoon »Link to Post - Back to Top  IP: Logged
gonzo
Newbie
*
member is offline





Joined: Apr 2007
Posts: 5
 Re: paddle?
« Reply #12 on Apr 5, 2007, 6:28pm »

Well, like I said, I'm happy to be corrected - but if one terminal of a potentiometer is wired to ground then that's what makes it a voltage divider, right? Maybe this is what was causing problems? A voltage divider would still be able to charge a capacitor, just not the same way you'd expect a variable resistor to?
Link to Post - Back to Top  IP: Logged
spiff
Senior Member
****
member is offline

[avatar]


[homepage]

Joined: Sept 2006
Gender: Male
Posts: 353
Location: Virum, Denmark
 Re: paddle?
« Reply #13 on Apr 6, 2007, 7:23am »


Quote:
Well, like I said, I'm happy to be corrected - but if one terminal of a potentiometer is wired to ground then that's what makes it a voltage divider, right? Maybe this is what was causing problems? A voltage divider would still be able to charge a capacitor, just not the same way you'd expect a variable resistor to?

Nope, to have a voltage divider, one end should be tied to ground, and the other end tied to a fixed voltage. The wiper then presents a voltage proportional to the position (assuming no load). Actually, for it to be a voltage divider it does not need to be wired to ground, but could be any fixed voltage. So basically, a voltage divider would be constituted by two fixed voltages at either end of the pot, and the output from the wiper.

Of course it would also be a voltage divider if the pot was replaced by two fixed-value resistors.

I haven't looked at the schematics, but it is not that uncommon to wire one end of pot together with the wiper. I have no good explanation for why this is done, but I have seen it time and time again. I guess one possible explanation is that in case of a bad connection between the wiper and the resistor material, you get the rated value of the pot instead of no connection at all.

Also, if it is wired to ground at one end, it seems likely that it is used as a discharge resistor for some capacitor. The cap is charged to a specific voltage, then discharged through the resistor. By measuring the time it takes to discharge the cap to a certain voltage, the value of the resistor can be estimated. Not very accurately, but very cheap ;)
Link to Post - Back to Top  IP: Logged

Mikkel Holm Olsen
AKA Spaceman Spiff
gmoon
Wizard's Apprentice
*****
member is offline

[avatar]


[homepage]

Joined: Mar 2006
Gender: Male
Posts: 876
Location: Ohio, USA
 Re: paddle?
« Reply #14 on Apr 6, 2007, 7:26am »


Quote:
Well, like I said, I'm happy to be corrected - but if one terminal of a potentiometer is wired to ground then that's what makes it a voltage divider, right? Maybe this is what was causing problems? A voltage divider would still be able to charge a capacitor, just not the same way you'd expect a variable resistor to?

1) The paddle circuit on the schematic isn't a voltage-divider. A voltage-divider needs a voltage reference at one end (usually VCC), a voltage reference at the other end (usually GND) and the tapped divided voltage (the POT wiper in this case.) The wiper and one side of the POT are connected, so the 'tap' will always equal the voltage at that side of the POT--the voltage is never 'divided.'

It's usually good design to tie a wiper to one end of a POT when it's used as a variable resistor--it's practically identical electrically to the same setup without the two tied together. But if the POT goes bad, the resistance can't jump to infinity.

When I indicated it could work as one, I meant it could be part of a voltage-divider, assuming there are other unseen components in the ASIC. I can think of some strange reasons why they might have done that, but all are a stretch...especially given that the POT on the Hummer IS wired as a voltage-divider.

2) Sure, a voltage-divider can charge a cap.


[EDIT] Opps. Looks like spiff and I were answering simultaneously.
« Last Edit: Apr 6, 2007, 7:29am by gmoon »Link to Post - Back to Top  IP: Logged
Page 1 of 2 » Jump to page   Go    [Search This Thread][Send Topic To Friend] [Print]

Google
Webjledger.proboards.com
Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!
Terms of Service | Privacy Policy | Report Abuse | Mobile