TMP92CZ26A

92CZ26A-568

3.20.4 X/Y position measuring procedure

In the INT4 routine, e xecute an X/Y p osition measuring procedure like belo w.
<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-positi on can be measured by c onverting this vo ltage to digit al code with AD converter.
<Y position measurem ent>
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-positi on can be measured by c onverting this vo ltage to digit al 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 pe n touches a corner area on touc h screen, analog- voltage will not be to 3 .3V
or 0.0V. As a notice, sinc e each resistor has an uneven, consider about it. And it is recommended
that an average code among a few times AD c onversion 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)) × A VCC [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 abov e
formula is for X-position.
Note2: Rty = R1+R2.