home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / ibm / pc / hardware / 29914 < prev    next >
Encoding:
Text File  |  1992-11-15  |  2.8 KB  |  66 lines

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