Jump to content
IGNORED

Reading Paddles


Recommended Posts

I'm trying to interface an analogue curcuit to a A8 via the paddle input, my problem is

that it only updates the paddle values on stage 2 Vblank, so every 50th/60th of a second

which is a bit slow for my needs.

 

My question is:- can the paddles be read accurately at a faster speed than that, I've looked at

the Tech Notes etc. but can't verify if its possible.

Link to comment
Share on other sites

From what I recall, as PotGo is used to discharge the capacitors its basically the time needed for these to settle again.

That could be established by using a few fixed value from the paddles, set the Critical flag so that stage 2 routines aren't used and use a Pokey timer routine to set the shadow values and then write to PotGo.

Start short and if the values in the shadow registers don't match the expected values then lengthen the timer.

Equally you could probably achieve this equally as well with a loop to monitor VCount or use DLIs.

Edited by Wrathchild
Link to comment
Share on other sites

Standard scan mode is every 228 scanlines - they can return a value quicker but that's the maximum so should be assumed so.

That's not far off the NTSC rate (262) - in theory you could do away with the OS routine and do your own that speeds it up to every 230 or so but hardly worth it.

 

Fast Pot scan mode does it in 228 cycles (2 scanlines) which is somewhat quicker.  The downside is that the accuracy will be somewhat less.

If you can put up with the extra jitter then you could put them in fast scan mode and just leave the OS routine in place.

If you only want a dozen or so readings per frame you could use DLIs which read the current POT value then start a new scan (POTGO).

ALLPOT should be sampled first to ensure the previous reading is complete.

 

From memory the Atari paddles operate on a resistance of 0-1M Ohms (Commodore uses 500K) - so you'd want your values spaced about evenly in that range.  Low resistance should = lower POTn value since the voltage threshold of the caps is reached faster.

Link to comment
Share on other sites

Do not use Wikipedia for Atari hardware documentation. Quite a lot of information on that POKEY page alone is a mixture of wrong information and badly reworded text from various sources like the Atari Hardware Manual.

 

POTGO only (re)starts the pot scan and turns off the dumping transistors. The dumping transistors are on whenever no scan is occurring. The subtle distinction matters because if a scan is truncated by hitting POTGO too early, the dumping transistors won't have turned on in between and the counts will be too low by the amount the caps have already been charged or may not update at all.

 

Merely turning on fast pot scan won't work to read paddles because the dumping transistors are disabled, both during and outside of pot scan. On real hardware, enabling fast scan with paddles just causes the caps to charge past threshold and stay there, after which the POTn registers stop updating no matter how many times POTGO is hit. This means that by default, fast scan is only usable for reading digital inputs like the keyboard controller through ALLPOT. To make it work with a paddle-like variable resistance, it is necessary to temporarily switch to slow scan outside of pot scan to drain the caps. It takes about 40 cycles to reliably drain the caps.

 

Even with that fixed, you can't use fast pot scan with the same resistances that would be used with slow pot scan. The pot scan works by measuring the amount of time for each capacitor to charge up to threshold over the connected resistance. Since fast scan runs 114x times faster, it measures counts that are 114x higher for the same resistance -- which means that with paddles you'll just get a tiny portion of the rotation range mapped to 0-228. Fast scan requires a much smaller resistance range to charge up the capacitors more quickly.

 

  • Like 2
Link to comment
Share on other sites

@Rybags thats what I have already started coding, thanks, confirms I'm heading the right way.

 

@phaeron many thanks for that information, I'm not using "pots", I'm using the ouput of a Op Amp to feed

the Paddle input, I seem to be getting reasonable readings although I might have to change the input resistance

to the paddle, what I was finding is the read rate at Vblank speeds was a bit slow for the input waveform.

 

With the extra information you have given, I will attempt to update my code and see what I get.

 

thanks both again

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