Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Joystick Port - Resistance

Status
Not open for further replies.

prprog

Member
I am building a software/Hardware MIDI controller. The hardware is about using the PC Joystick port to read potentiometers and buttons. I read that the joystick port used a timer (555) and a RC combination to calculate the potentiometer resistance values based on how much time it takes for the capacitor to charge. Good so far. The point is that when I try 10K pots to build a music keyboard , the readings of the 10K pot (or 1k pots) are of 2 values (example 1279 or 1356 ) they are ALWAYS this 2 values. I can manage this behaviour in the sofware, but can you tell me why it reads 2 values for every 10k resistor (the values are in pairs but always the same pair values)?

Example: (these are not the actual values, but just the concept of what the reading are generated). I though that I will get only one value for each resistance.

10K -> 1279 or 1356
20k -> 1450 or 1546
30k -> 1600 or 1680
etc,

Again, don't try to make any calculation with this values. There are not the actual readings.

Thanks
 
Why not use whatever microcontroller you plan to use do the A/D work instead of a 555?

The idea is to used the PC as the "processing/controller" to translate the circuit information (resistance, buttons) to MIDI data. So no microcontroller is used. The question is about understanding why the PC internal circuit (which I cannot or wil not change) give pair of values on an specific resistance value.

Thanks
 
The PC's joystick port has the 555 built in. You just need a pot between GND and the input pin. It's and old and somewhat tempermental setup.
 
The PC's joystick port has the 555 built in. You just need a pot between GND and the input pin. It's and old and somewhat tempermental setup.

Yes , temperamental indeed.
The connection is between +5V and the input pin. GND is not used for pot reading.

Anyway, any idea why I get 2 values per resistance reading?. The 2 values appear in a random fashion.

Is this what happen in a 555 RC circuit. Maybe there is some way to stabilize the reading by using some component (Capacitor?)?

Thanks,
 
it's the way they work. The 555 is setup as a one shot and it's polled so the results will vary. Can you modify a USB joystick as they were far better.
 
it's the way they work. The 555 is setup as a one shot and it's polled so the results will vary. Can you modify a USB joystick as they were far better.

That's the one I am using (hacking). It is a USB Joystick.

What is interesting is that a 10k resistor will give exactly to different values in a random way. ???
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top