Re: Commodore joystick ports

From: Jim Brain (brain_at_jbrain.com)
Date: 2004-10-22 23:12:48

Scott McDonnell wrote:

>Jim,
>
>As Hársfalvi mentioned, it is current that needs to be generated, not
>voltage. A resistor creates a voltage drop across it, which is a function of
>current. (Resistance=Current/Voltage) The voltage is 5V, the resitance is a
>range that you know from the potentiometer values, you simply need to create
>the corresponding current to emulate the resistance you need.
>  
>
The nitpicker in me always thought it was V=IR, so R=V/I... 

I looked at a resistor ladder DAC, but I don't have 16 IO pins to spare 
(8 per POT), and the board real estate for 2 ladder DACs puts me way 
over the .625x.625" pcb space I have to work with. (On a related note, 
anyone have a source for a bit larger DE9 shells?)

>in 256 different currents at each axis input. Probably way more resolution
>than a commodore mouse provides.
>  
>
Oh, I don't know.. If someone wanted to re-use this as a 1351 mouse 
emulator, they'd need either a stable 7 bit resolution (1351 discards 
low bit due to timing issues), or 8 bit resolution.

I'd travel down the path, but as of last night, the idea used by the 
1351 designers and Hársfalvi noted in his project is working pretty 
well.  I can get from 10 to 255 on the POT lines using 2 10K resistors, 
configured as noted in his PIC mouse project plans, and the jitter is < 
+-3 (I cleaned up my code to reduce execution times), and only uses 3 
pins on the AVR (INT1 and 2 data pins).  

Last night, I hooked both POT lines up to the scope, and wrote some code 
to get data from a "smart" joystick controller.  The controller sends 
data to the AVR in digital packets, and I pulled out the proportional 
joystick data and fed it to my paddle emulator code.  It's hard to 
describe, but moving the joysticks and watching the width of the charge 
cycle get longer or shorter is very gratifying.  Right now, code is 
pretty solid, though I'm using a 7.3MHz crystal for the project, which 
makes the cycle period/8 a bit longer than 1uS.  I need to buy a 8MHz 
crystal and recalibrate for that slightly faster speed. 

Jim

       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.