home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.ibm.pc.hardware
- Path: sparky!uunet!newshost!root
- From: bmehlman@trirex.com(Ben Mehlman)
- Subject: Re: Help with Joysticks
- Message-ID: <1992Nov15.092716.29202@Trirex.COM>
- Sender: root@Trirex.COM (Operator)
- Reply-To: bmehlman@trirex.com
- Organization: Trirex Systems Inc.
- References: <1992Nov12.094039.1324@samba.oit.unc.edu>
- Date: Sun, 15 Nov 1992 09:27:16 GMT
- Lines: 53
-
- In article <1992Nov12.094039.1324@samba.oit.unc.edu>
- Dan.Bjorklund@launchpad.unc.edu (Dan Bjorklund) writes:
- >
- > HEELLPP!!! :) Does anyone know how the joystick on a PC works? I
- don't
- > need the pinouts I just need to know how it works. What signals does it
- > send to the port.
- >
- > Dan.Bjorklund@bbs.oit.unc.edu
- >
- >
- >
- > --
- > The opinions expressed are not necessarily those of the University of
- > North Carolina at Chapel Hill, the Campus Office for Information
- > Technology, or the Experimental Bulletin Board Service.
- > internet: laUNChpad.unc.edu or 152.2.22.80
-
- There's a pin on the joystick port that supplies +5 volts to one end of
- the 100 Kohm potentiometers in the joystick. The pots are wired to
- provide a simple variable resistance NOT as a voltage divider. The other
- side of these pots are connected to input pins on the connector. Here's
- basically how the PC knows the position:
-
- Inside the pc is a capacitor for each pot. This capacitor can be
- connected 2 different ways via cmos switches. There is also a counter,
- and a comparator (ie op amp) which takes one input from the capacitor, the
- other input from a reference voltage somewhere between 0 and 5 volts.
-
- To read the position, first the capacitor is shorted to ground so that
- it's completely discharged. Next, the capacitor is connected to the input
- from the joystick, and at the same time, the counter starts counting at a
- specific rate (divided down from a clock). When the capacitor is charged
- to the reference voltage (as detected by the comparator), its output
- changes causing the counter to stop. The number in the counter is higher
- when the capacitor thakes longer to charge ie when the resistance of the
- pot is higher.
-
- Does this sound a little inexact??? It does to me too! But that's how it
- works! Actually, this is the same circuit that was used in the Apple ][,
- which is why the joysticks are identical...
-
- The end result for me was, I didn't use the joystick port for a data
- aquisition application I was working on. I instead bought an inexpensive
- multiplexed A/D board that connects to the serial port...
-
- --
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- \|/ Ben Mehlman Indigo..
- ^ ^ Trirex Systems Inc
- # # bmehlman@trirex.com Indigoing..
- @
- \___/ >NeXTMail Welcome< Indigone.
-