Download Print this page

Toshiba TLCS-900/H1 Series Manual page 430

Original cmos 32-bit microcontroller
Hide thumbs Also See for TLCS-900/H1 Series:

Advertisement

3.19.4
X/Y Position Measuring Procedure
During the INT4 routine, execute an X/Y position measuring procedure as below.
<X position measurement>
Make both the SPX and SMX switches ON, and the SPY and SMY switches OFF.
With this setting, an analog voltage which shows the X position will be input to the
PG3/MY/AN3 pin. The X position can be measured by converting this voltage to digital
code using the AD converter.
<Y position measurement>
Next, make both the SPY and SMY switches ON and the SPX and SMX switches OFF.
With this setting, an analog voltage which shows the Y position will be input to the
PG2/MX/AN2 pin. The Y position can be measured by converting this voltage to digital
code using the AD converter.
The above analog voltage which is inputted to AN3 or AN2 pin can be calculated as
follows.
It is the ratio between the resistance value in the TMP92CH21F and the resistance value
in the touch screen as shown in Figure 3.19.5.
Therefore, if the pen touches an area on the touch screen, the analog voltage will be
neither 3.3 V nor 0.0 V.
Please remember to take into consideration the variation in the rate of resistance.
It is also recommended that an average taken from several AD conversions be adopted as
the correct code.
SPY (SPX)
ON resistor: Rpy (Rpx)
20 Ω (typ.)
Touch screen resistor: Rty (Rtx)
The value depends on the
touch screen.
SMY (SMX)
ON resistor: Rmy (Rmx)
20 Ω (typ.)
[Formula to calculate analog voltage (E1) to AN2 or AN3 pin]
AVCC = 3.3 V
E1 = ((R2 + Rmy)/(Rpy + Rty + Rmy)) × AVCC [V]
Example:
R1
AN2 (AN3) pin
R2
Touch point
Figure 3.19.5 Calculation Analog Voltage
92CH21-428
When AVCC = 3.3 V, Rpy = Rmy = 20 Ω,
R1 = 400 Ω and R2 = 100 Ω
E1 = ((100 + 20)/(20 + 400 + 100 + 20)) × 3.3
= 0.733 V
Note 1: An X position can be calculated in the same way
though the above formula is for Y position.
Note 2: Rty = R1 + R2.
TMP92CH21
2009-06-19

Advertisement

loading

This manual is also suitable for:

Tmp92ch21fgJtmp92ch21