News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Bryce

Analogue Joystick Adapter

Started by Bryce, 15:41, 12 October 10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bryce

Hi all,
      Last night I found a really good PC Analogue joystick (the old 15pin connector type) hidden in one of my many boxes of old hardware. Has anyone ever made an adapter for it to work on my 6128 (ie: Analogue to digital) ? Or am I going to have to go to the bother of designing one if I want to use it?

Bryce.

arnoldemu

Quote from: Bryce on 15:41, 12 October 10
Hi all,
      Last night I found a really good PC Analogue joystick (the old 15pin connector type) hidden in one of my many boxes of old hardware. Has anyone ever made an adapter for it to work on my 6128 (ie: Analogue to digital) ? Or am I going to have to go to the bother of designing one if I want to use it?

Bryce.
Would the result be like a normal digital joystick, or are you talking about some way to read an analogue style joystick and the analogue values through the cpc's joystick port?

I've never seen an adaptor.. so go on ;)
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Bryce

Yes, I don't want to read the analogue values into the CPC, I just want to use it as a standard digital joystick, so a circuit in between, reading the analogue values, sending the associated digital signals and the CPC thinks a digital joystick is connected. It would also be nice if I could choose at which point the joystick triggers, so I could choose how sensitive the joystick reacts.

Generally, I find the analogue joystick is a lot nicer to use, because it has a smoother feel to it and there's no permanent clicking ruining my favourite CPC sound track (except for fire of course).

I couldn't find anything on the web, so I assume no-ones bothered doing it yet  :(

Bryce.

steve

I don't know much about electronics, but it sounds simple to me.
The joystick will give you a voltage ranging from 0 to 5v, connect that to a digital circuit that will output a 0 for a voltage up to 2.5v and another circuit to give a 1 for a voltage from 2.5v to 5volts., 2 outputs for x, same again for y.

Bryce

#4
Uuuuh, no it' not that simple, the joystick doesn't output 0-5V it's just a passive variable resistor inside. Also there's only 2 variable resistors, one for x and one for y, so to use your example 0-2.4v would be left and 2.6-5v would be right (with a small range of values in the middle when neither right nor left is chosen). So a decent ADC would be required with some intelligence (a µP) to decide at which value to switch which inputs and what range of values the dead-point in the middle is.

But either way, that's a very simple view of circuitry you take! Using that logic, a TV would be simple to build, you just need two circuits, one for the sound and one for the picture :D

Bryce.

steve

#5
With a variable resistor, one end of the resistor track is connected to ground, the other end connected to 5v or whatever the operating voltage is, the centre (moving) contact picks up a voltage from the resistor track ranging from 0 to 5v (or whatever) and presents that as the analogue voltage.

A transistor will act as a switch depending on the voltage at it's base (I think) so there you have the basis of what you want to do, you need four outputs to give up, down, left and right.

P.S the joystick mechanism I have has 4 VR's.

Bryce

Wow, never saw a joystick with 4 VRs, what make is it? The analogue joystick I have here has only two, but it doesn't have both 0v and 5v connected to the VRs, just 5v at one end and output from the slider, the other end isn't connected.

You're correct with the transistor theory (and yes the base is the one that senses), but it would be complicated: One transistor would have to switch below 1v for example and the other would switch at 4v, but you would then need a second transistor to turn off the 1v transistor above a certain level, otherwise at 2.5v (centre) it would still be on and at 4v both transistors would switch on. Also transistors don't tend to digitally switch, they ramp up, so you would have to "tune" them frequently to ensure they always switch at the same point. At this stage the transistor count has got up to about 8 transistors with a few resistors and VRs for each one. A small 14 pin ADC could do all this for you more reliably for half the price and less PCB space.

Bryce.

steve

I do not know enough about electronics to continue this discussion, you are probably right in thinking an ADC would be simpler, I was wondering if it would make much difference to the complexity of the transistor circuitry if the 5v supply was connected to the wiper and a  transistor circuit connected to each end of the resistor track?

The two joystick mechanisms I have are at least 30 years old and mostly metal in construction, they were most likely used in R/C transmitters.
Maybe I will get around to wiring them up to the Amstrad's analogue joystick ports one day.

Bryce

It's all just theory at the moment anyway. I don't think moving the 5v to the slider would really change anything though. I'll do some measurements when I have time and come up with the simplest / cheapest circuit possible, with some easy way of setting the switching point so that I can set between sensitive/non-sensitive. And it's also important that the adapter works with most if not all analogue joysticks. If anyones interested in the resulting adapter they can let me know, I'll probably put it on the wiki anyway.

Bryce.

steve

#9
Now I've thought about this some more I think you could connect 5v to the wiper and connect the two ends to the bases of two transistor circuits that will switch on above 2.5 volts.
One transistor circuit will give the left output and the other the right output.
You may need more transistors to get a ttl compatible output but that's OK.
Maybe there are some TTL logic chips that could be used to perform this function.

Bryce

Yes, that would work and probably be the simplest adapter, but it would mean having to modify the joystick internally. I wanted something where no changes were needed to the joystick, you could just connect any PC joystick and it would work.

Bryce.

steve

I overlooked the requirement that the unit work with any joystick, so the best option is as you say, an ADC.

Powered by SMFPacks Menu Editor Mod