![](http://datasheet.mmic.net.cn/180000/PC87393F-VJG_datasheet_11343432/PC87393F-VJG_85.png)
5.0 Game Port (GMP) (Continued)
85
www.national.com
The varying resistors RVX and RVY are usually implemented in the game device. Their resistance values are determined
directly by the horizontal and vertical positions, respectively, indicated by the game device. The waveform shaping circuits
are usually implemented outside the game device using constant resistors (RCX/Y) and constant capacitors (CX/Y). Together
with RVX/Y, these components implement two R-C structures, the varying parameters of which are used to determine the
exact momentary position indicated by the game device.
When the Game Port is enabled and not in the midst of a game device position reading process, it drives the JOYnX,Y pins
low. In this state, the capacitors CX/Y are completely discharged.
5.2.2
Capturing the Position
The process of capturing the position indicated by the game device is initiated by a command given to the Game Port to
release the JOYnX,Y lines, thus allowing the capacitors CX/Y to be charged. This command is given by performing a write
access to offset 1 from the Game Port base address, which is the offset of the Game Port Legacy Status Register (GMPLST,
see Section 5.3.3). Once JOYnX,Y pins are released, RCX/Y and RVX/Y start charging CX/Y, and the voltage level of the JOYnX,Y pins increases until it reaches VIH. This process is described in Figure 15. Figure 15. Position Reading Process Waveform (not drawn to scale)
The vertical and horizontal positions indicated by the game device are determined by measuring the time it takes for the
voltage level on the JOYnX,Y pins to reach the level of logic 1. Since the charging time is determined by the resistance val-
ues of RVX/Y, measuring this time actually indicates the resistance values of RVX/Y, and therefore also reflects the position
indicated by the game device.
Once an axis pin is sensed as logic 1, the axis circuit discharge control is activated in order to discharge CX/Y. This causes
the corresponding axis pin to be driven low for approximately 1.5
sec. After that, this axis line is held low until another po-
sition reading process is initiated.
During the charge time and the 1.5
sec discharge time which follows, the corresponding axis line does not respond to any
reading process initiation. This prevents software from disturbing the position reading process and makes the position read-
ing processes of all axis lines independent of each other.
5.2.3
Button Status Indication
The button(s) status indication mechanism is described in
Figure 16. Although this figure shows an active-low button
(RBU0>>RBD0), the polarity of the button can be either high or low, assuming that the Game Port software is aware of the
button’s polarity.
Figure 16. Game Device Button Status Indication Mechanism
Time
VCX/Y [V]
VDD
0
VIH
Time measured as
position indication
Discharge
Charge
Idle
Drive
Low
Release
Drive
Low
RBU0
Game
Port
JOYnBTN0
JOYnBTN1
Game Device Button Status Circuit
Pins
Buttons 0,1
Status
Indicators
Input Path
RBD0