Toshiba H1 Series Network Card User Manual


 
TMP92CZ26A
92CZ26A-568
3.20.4 X/Y position measuring procedure
In the INT4 routine, execute an X/Y position measuring procedure like below.
<X position measurement>
At first, set both SPX, SMX-switches to ON, and set SPY, SMY-switches to OFF.
By this setting, analog-voltage which shows the X-position will be inputted to PG3/MY/AN3
pin.
The X-position can be measured by converting this voltage to digital code with AD converter.
<Y position measurement>
Next, set both SPY, SMY-switches to ON, and set SPX, SMX-switches to OFF.
By this setting, analog-voltage that shows the Y-position will be inputted to PG2/MX/AN2
pin.
The Y-position can be measured by converting this voltage to digital code with AD converter.
The above analog-voltage that is inputted to AN3 or AN2-pin can be calculated. It is a ratio
between resistance-value in TMP92CZ26A and resistance-value in touch screen shown in
Figure 3.20.5.
Therefore, if the pen touches a corner area on touch screen, analog-voltage will not be to 3.3V
or 0.0V. As a notice, since each resistor has an uneven, consider about it. And it is recommended
that an average code among a few times AD conversion will be adopted as a correct code.
Figure 3.20.5 Calculation analog voltage
A
VCC=3.3V
SPY (SPX)
ON-resistor: Rpy (Rpx)
typ.10Ω
SMY (SMX)
ON-resistor: Rmy (Rmx)
typ.10Ω
Touch screen resistor
: Rty (Rtx)
A value depends on
a touch screen.
R1
R2
Touch-point
A
N2 (AN3)-pin
[Calculation for analog input voltage to AN2 or AN3-pin : (E1)]
E1 = ((R2+Rmy) / (Rpy+Rty+Rmy)) × AVCC [V]
Ex.) The case of AVCC=3.3V, Rpy=Rmy=10Ω, R1=400Ω and
R2=100Ω
E1 = ((100+10) / (10+400+100+10) × 3.3
= 0.698V
Note1: A Y-position can be calculated in the same way though above
formula is for X-position.
Note2: Rty = R1+R2.