I needed to support an old legacy analog PC joystick on a very old computer that had a total different ADC interface. Not only the pin out was different, the voltages, the range of operation... totally incompatible.
Old legacy analog PC joysticks are different from what you expect. The pots on the X or Y axis are not voltage dividers - they have no 0v0. So, the PC had to handle the voltage divider. Look at the first diagram it shows no 0v0 on the pots.
And, the total resistance of the legacy analog PC joystick. is 120k but the range is 35k to 85k.
The need was to read the legacy analog PC joystick., and, then convert to a 0k to 10k range with a VREF of 1v8.
I want to be able to simply connect the two 15 ways connectors to something and thhe solution should just work.
The solution is very simple. Read the ADC(s) from the joystick, scale these results, send to Digital Pot. See code below. In the code below, I read ADC port 1 ( AN1 ) into a variable called Xadc then write the result variable called ResX to channel 0 -same for the other axis.
A test ADC test program on the target computer shows ranges as 320 to 65520 - which is correct for that specific ADC.
I used the LGTF328P UNO shield ( £3.20 .. or a lot more from my eBay!), a MCP4261 Digital Pot ( £1.60 ) and a few connectors.
All most any PIC, AVR or LGT microcontroller will work. I think an 8 pin device would work as the SPI between the microcontroller and the Digital Pot can use software SPI, therefore, any port.pin on the microcontroller should work. The LGT microcontroller works at 32mHz ( twice as fast as the UNO ) but I have tested down to slow frequencies and all is good for low power use ( maybe direct from the Beeb PSU).
With this solution used the computers VRef as the input side of the Digital Pot Terminal, and the Digital Pot Wiper back the computer.
I needed to support an old legacy analog PC joystick on a very old computer that had a total different ADC interface. Not only the pin out was different, the voltages, the range of operation... totally incompatible.
Old legacy analog PC joysticks are different from what you expect. The pots on the X or Y axis are not voltage dividers - they have no 0v0. So, the PC had to handle the voltage divider. Look at the first diagram it shows no 0v0 on the pots.
And, the total resistance of the legacy analog PC joystick. is 120k but the range is 35k to 85k.
The need was to read the legacy analog PC joystick., and, then convert to a 0k to 10k range with a VREF of 1v8.
I want to be able to simply connect the two 15 ways connectors to something and thhe solution should just work.
The solution is very simple. Read the ADC(s) from the joystick, scale these results, send to Digital Pot. See code below. In the code below, I read ADC port 1 ( AN1 ) into a variable called Xadc then write the result variable called ResX to channel 0 -same for the other axis.
A test ADC test program on the target computer shows ranges as 320 to 65520 - which is correct for that specific ADC.
I used the LGTF328P UNO shield ( £3.20 .. or a lot more from my eBay!), a MCP4261 Digital Pot ( £1.60 ) and a few connectors.
All most any PIC, AVR or LGT microcontroller will work. I think an 8 pin device would work as the SPI between the microcontroller and the Digital Pot can use software SPI, therefore, any port.pin on the microcontroller should work. The LGT microcontroller works at 32mHz ( twice as fast as the UNO ) but I have tested down to slow frequencies and all is good for low power use ( maybe direct from the Beeb PSU).
With this solution used the computers VRef as the input side of the Digital Pot Terminal, and the Digital Pot Wiper back the computer.
Brilliant it works!
The layout was easy. Adapt the pot within the joystick to have a common 0v0, and attach a MCP4261 ( a two port digital 10k pot). Very simple.
Last edit: Anobium 2023-09-02
This solution should work on most microncontroller - it can software SPI ( bit banging.
I used the LGT as they are so cheap. :-) and, robust.