Searching \ for 'Simple joystick converter' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=simple+joystick
Search entire site for: 'Simple joystick converter'.

Truncated match.
PICList Thread
'Simple joystick converter'
1998\12\24@050825 by Pablo Bleyer Kocik

flavicon
face
part 0 1837 bytes
x-html> Hi!
    I'm currently building a 16F84-based telescope mount control with step motors and I'm using a gamepad as the main user interface peripheral. This is a typical Gravis-compatible gamepad, with a nine position joystick and four buttons. The gamepad is a perfect solution for my control, it works fine and looks great ;^) . However I'm looking for a simple converter for the gamepad's joystick; I've used PC-like circuits (with 555-like monoastabl es) and comparators with good results, but this is just too much for the simple 3 position joystick's stick of each axis (0 Kohms when up, 50 K when middle, 100 K when down). I need to convert these positions to two bits (10 when the stick is up, 01 when the stick is down, and 00 (or 11) when the stick is in it's natural position). Any ideas for a _simple_ circuit doing this?

            & nbsp;    +--+
+5V O--\/\/\---> |  |-> bit0
         R   &nbs p;   |  |-> bit1
                  +--+

R: 0-50-100 KOhms

Thanks and happy, happy holidays! Merry Xmas and a prosperous new year!!!

-- 
Pablo Bleyer Kocik |"The most exciting phrase to hear in science, the 
pbleyer            | one
that heralds new discoveries, is not `Eureka!' 
    @dgf.uchile.cl | (I found it!) but `That's funny...'" -Isaac
Asimov
 

1998\12\24@054015 by Mark Willis

flavicon
face
Sounds like a job for linear electronics <G>  Think 2 Op-Amps, set up
as voltage comparators, each outputs a 1 when the output is beyond it's
set point;  Something like this {Note that the /|\ is a "Crossover", not
a connection!}  Double-check me on it as it's late & I am in a rush to
get supplies before the Christmas Storm of '98 closes us down here <G>

 BTW, if the joystick has one end at +5 and the other end at Gnd, omit
the 50k resistor there as ground is already handled <G>

 This would generate 10, 00, 01; For 11 in the middle, swap the
connections from the ends of the 10k resistor to the voltage
comparators.

 (You're responsible for power to the Voltage Comparators/OpAmps, just
power them from Gnd and +5 Volts - and you may want to buffer them if
necessary, unlikely though. <G>)

                     |\
Gnd O---\/\/\--+-----|+\
         40k   |     |  }------  Bit 0
               \  +--|-/
               /  |  |/
           10k \  |
               /  |  |\
               |  +--|+\
               |  |  |  }------  Bit 1
      +-\/\/\--+-/|\-|-/
      |  40k      |  |/
+5V O-+-\/\/\--+--+
          R    |
               |
Gnd O---\/\/\--+
        50k

 Mark, spam_OUTmwillisTakeThisOuTspamnwlink.com

Pablo Bleyer Kocik wrote:
{Quote hidden}

1998\12\24@061547 by Pablo Bleyer Kocik

flavicon
face
part 0 1734 bytes
x-html> Mark Willis wrote:
Sounds like a job for linear electronics <G>  Think 2 Op-Amps, set up
as voltage comparators, each outputs a 1 when the output is beyond it's
set point;  Something like this {Note that the /|\ is a "Crossover", not
a connection!}  Double-check me on it as it's late & I am in a rush to
get supplies before the Christmas Storm of '98 closes us down here <G>

  BTW, if the joystick has one end at +5 and the other end at Gnd, omit
the 50k resistor there as ground is already handled <G>

  This would generate 10, 00, 01; For 11 in the middle, swap the
connections from the ends of the 10k resistor to the voltage
comparators.

  (You're responsible for power to the Voltage Comparators/OpAmps, just
power them from Gnd and +5 Volts - and you may want to buffer them if
necessary, unlikely though. <G>)

Thanks for your answer, Mark, but actually that's the same solution I'm usi
ng now (comparators). What I'm seeking is a _simpler_ circuit that will do the s
ame job. The reason for this is to use the least number of components possible..
.
Cheers!




-- 
Pablo Bleyer Kocik |"The most exciting phrase to hear in science, the 
pbleyer            | one
that heralds new discoveries, is not `Eureka!' 
    @dgf.uchile.cl | (I found it!) but `That's funny...'" -Isaac
Asimov
 

1998\12\24@072934 by paulb

flavicon
face
Pablo Bleyer Kocik wrote:

> joystick's stick of each axis (0 Kohms when up, 50 K when middle, 100
> K when down). I need to convert these positions to two bits (10 when
> the stick is up, 01 when the stick is down, and 00 (or 11) when the
> stick is in it's natural position). Any ideas for a _simple_ circuit
> doing this?

>                  +--+
> +5V O--\/\/\---> |  |-> bit0
>          R       |  |-> bit1
>                  +--+


                      |\
     In O--------+----| o----O ">70k"
                 |    |/
                 >            Inverters are 74HC04
                 > 22k     *NOT* 74HCT04, *NOT* 74HC14
                 |    |\
                 +----| o----O ">25k"
                 |    |/
                 >
                 > 47k
                 |
                ~~~ Gnd
--
 Cheers,
       Paul B.

1998\12\24@110657 by Mark Willis

flavicon
face
Pablo Bleyer Kocik wrote:
>
> Mark Willis wrote:
>
> > Sounds like a job for linear electronics <G>  Think 2 Op-Amps, set
> > <snip>
>
> Thanks for your answer, Mark, but actually that's the same solution
> <snip>
> --
> Pablo Bleyer Kocik |"The most exciting phrase to hear in science, the
> pbleyer            | one that heralds new discoveries, is not `Eureka!'
>     @dgf.uchile.cl | (I found it!) but `That's funny...'" -Isaac Asimov

 Ack, sorry (Yesterday was a busy day, and I'm up again <G>)  I've been
stuck in "teach basic electronics mode", trying to recruit one guy into
learning PICs...

 Mark, .....mwillisKILLspamspam@spam@nwlink.com

1998\12\24@122802 by Peter L. Peres

picon face
> convert analog joystick to 9-square grid in binary

Use a quad comparator or op-amp (LM324 ?) and a 1/4 and 1/2 Vdd reference
divider to obtain HIGH/[MID]/LOW for each pot. The 1/2 Vdd reference means
that each pot must be connected to +Vdd through a 47k resistor to achieve
~2/3 Vdd full scale (amd stay in the CMMR of the 324), or both in parallel
through 22k. The other end of the pots should be GND.

hope this helps,

Peter

PS: You could use AN512 (number ?) to convert directly with the PIC but I
assume it is already busy with other duties.

1998\12\24@143959 by Michael J. Ghormley

flavicon
face
Pablo Bleyer Kocik wrote:
>     I'm currently building a 16F84-based telescope mount control with
> step motors and I'm using a gamepad as the main user interface
> peripheral. This is a typical Gravis-compatible gamepad, with a nine
> position joystick and four buttons. The gamepad is a perfect solution
> for my control, it works fine and looks great ;^) . However I'm looking
> for a simple converter for the gamepad's joystick; I've used PC-like
> circuits (with 555-like monoastables) and comparators with good results,
> but this is just too much for the simple 3 position joystick's stick of
> each axis (0 Kohms when up, 50 K when middle, 100 K when down). I need
> to convert these positions to two bits (10 when the stick is up, 01 when
> the stick is down, and 00 (or 11) when the stick is in it's natural
> position). Any ideas for a _simple_ circuit doing this?

This may not be much help, but had you given any thought to using an old
Commodore/Atari joystick?  It just has four switches (no pots).  WOuldn't
this give you what you nedd and cost a lot less?

Just a thought...

Michael

*************************************************************************
When the way of the Tao is forgotten, kindness and ethics must be taught.
Men must learn to pretend to be wise and good.  --  Lao Tzu
*************************************************************************

1998\12\24@175527 by Ken Kaarvik

flavicon
face
<snip>
The gamepad is a perfect solution for my control
<snip>

I've had success reading a Nintendo 64 controller using an F84 and one pin.
I have the source code at:
http://www.cal.shaw.wave.ca/~kff/GB/KenKaarvik/N64toGB.html

The code is written to interface an N64 controller to a GameBoy but a couple
of changes and you could do anything. The code may look like overkill but
hey it works.

Ken Kaarvik
kkaarvikspamKILLspamaxion.net

1998\12\25@025357 by Pablo Bleyer Kocik

flavicon
face
   Many thanks to all who have answered my request. The circuit using
two inverter buffers posted by Paul B. Webster is pretty simple and it
might be useful, I'll try to test it this weekend. I'm avoiding to use
comparators/op-amps because the specifications are somewhat tight. I
know the job is ideal for digital joysticks, but we need at least four
buttons for special functions (change track velocity in manual aiming,
switch tracking type (lunar, solar, sidereal, king, etc.), select items
in displayed menus in a LCD, etc.). The [Gravis type] gamepad is handy
here (because it's something between a mouse and a joystick), and it's
cheap.
   Well, thanks a lot again, continue posting and have yourself a
wonderful xmas!

--
Pablo Bleyer Kocik |"The most exciting phrase to hear in science, the
pbleyer            | one that heralds new discoveries, is not `Eureka!'
   @dgf.uchile.cl | (I found it!) but `That's funny...'" -Isaac Asimov

1998\12\28@121417 by John Payson

flavicon
face
|    I'm currently building a 16F84-based telescope mount control with
|step motors and I'm using a gamepad as the main user interface
|peripheral. This is a typical Gravis-compatible gamepad, with a nine
|position joystick and four buttons.

For reading the two "simulated pot" signals from the Gravis,
I'd suggest taking two PIC I/O pins and wiring them to the
Gravis "analog" pins through fairly small resistors (probably
220ohm or so); place a small cap (0.001uF) on the Gravis side
of the resistors.

To read the joystick, ground both I/O pins for a couple micro-
seconds and then float them.  Each of the I/O pins will take
one of three amounts of time to read high again.  Note that
while the Gravis is emulating an analog device, it is in fact
digital internally and I would expect the readings from it to
be quite consistent (the PC joyports work by detecting how long
it takes to charge a cap; rather than trying to output an analog
current to charge the cap, it would be easier for the gamepad to
simply wait a certain length of time after its output is pulled
low before it pulls it high again).

By the way, a few of points to ponder:

[1] Why is the TRS-80 color computer the only home computer which
   uses the potentiometers in analog joysticks as actual potentio-
   meters [i.e. uses them to generate a *VOLTAGE* proportional to
   position]?  Although Tandy's joysticks were really quite feeble
   voltage-based pot sensing is much better from an EMC perspective
   and is much less sensitive to pot wear and tear than resistance
   based measurements.

[2] The PC's joystick port design is quite similar to that on the
   Apple ][; unfortunately, whereas all Apple ]['s run at basically
   the same speed, PC's are all over the map and getting good read-
   ings from the joyports can be a pain in the (derriere).

[3] Some computers like the Commodore VIC-20 and Commodore 64 used
   RC-based pot sensing, but had counter circuitry implemented in
   hardware to latch the readings automatically.  Commodore's mouse
   for the '64 actually used the pot inputs, but relied upon the
   fact that the input's count rate was known; reading the pot
   input value from the hardware would yield a number 0-127 which
   would wrap cleanly as the mouse continued to move (i.e. the num-
   bers read would go 125, 126, 127, 0, 1, 2, etc.)  Cute...

1998\12\28@142659 by Alan King

picon face
John Payson wrote:

> By the way, a few of points to ponder:
>
> [1] Why is the TRS-80 color computer the only home computer which
>     uses the potentiometers in analog joysticks as actual potentio-
>     meters [i.e. uses them to generate a *VOLTAGE* proportional to
>     position]?  Although Tandy's joysticks were really quite feeble
>     voltage-based pot sensing is much better from an EMC perspective
>     and is much less sensitive to pot wear and tear than resistance
>     based measurements.

 The resistor and cap to charge method is the most simple
possible, and therefore cheapest.  Anything that really puts
out a voltage takes more circuitry to read.  Doesn't matter
so much now, but at the time the Apple II and Atari 2600
were made, silicon was a lot more expensive.
 Also he needs to know if the gravis is truly a resistance
or voltage source to decide how to read it.  And if it is
resistance, may as well use the resistor cap method with two
diodes and read both pots on one pic pin, as some others
discussed a while back..

Alan

1998\12\29@121019 by John Payson

flavicon
face
> By the way, a few of points to ponder:
>
> [1] Why is the TRS-80 color computer the only home computer which
>     uses the potentiometers in analog joysticks as actual potentio-
>     meters [i.e. uses them to generate a *VOLTAGE* proportional to
>     position]?  Although Tandy's joysticks were really quite feeble
>     voltage-based pot sensing is much better from an EMC perspective
>     and is much less sensitive to pot wear and tear than resistance
>     based measurements.

|  The resistor and cap to charge method is the most simple
|possible, and therefore cheapest.  Anything that really puts
|out a voltage takes more circuitry to read.  Doesn't matter
|so much now, but at the time the Apple II and Atari 2600
|were made, silicon was a lot more expensive.

Reading four 'pots' with the Apple II or IBM PC method requires
two 556 (dual timer) chips, along with four caps.  The TRS-80's
method can be done with an 8-bit latch, a bunch of resistors (for
a D/A), and a quad analog comparator chip.  Not at all fancy,
really.

|  Also he needs to know if the gravis is truly a resistance
|or voltage source to decide how to read it.  And if it is
|resistance, may as well use the resistor cap method with two
|diodes and read both pots on one pic pin, as some others
|discussed a while back..

I described the way most Gravis-type devices work (neither a true
resistance, nor a voltage source, but instead a signal which will
pull high a variable amount of time after an external device pulls
it low).  It's possible that the device in question does not work
as I described, but it's a technique which has been used for awhile
and works nicely.


Attachment converted: wonderland:WINMAIL.DAT (????/----) (00023483)

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...