
228
EPSON
S1C88409 TECHNICAL MANUAL
APPENDIX: CONTROLLING THE TOUCH PANEL CONTROLLER
In this method, the coordinate data and switch
status information in the temporary area are
not rewritten while they are being read, so the
values can be guaranteed.
(2) Method 2
Set only a flag indicating that coordinate data
is updated in the coordinate update interrupt
service routine. The coordinate data and switch
status information (DX0–DX11, DY0–DY11,
PEN) are read in the main routine.
A.2.5 Calculating the LCD dot position
(1) Initial setting
The first process needs registration of dot
position between the touch panel and the LCD
panel. The following explains the X axis only as
the same applies to the Y axis. It assumes that
the origin of both the LCD and touch panels
are located at the left edge (in other words, the
leftmost dot on the LCD is dot 0; the touch
panel's A/D conversion value increase at the
right side).
First pen down at the leftmost dot position on
the LCD, and the touch-panel A/D converted
value is stored as x_min. Then pen down at the
rightmost dot position on the LCD, and the
touch-panel A/D converted value is stored as
x_max.
(2) LCD dot position calculation
The LCD dot position corresponding to the
pen-down position within the LCD display
area is calculated by the following expressions:
For x axis:
x_dot = (x_addat - x_min)
×
DXMAX
(x_max - x_min)
For y axis:
y_dot = (y_addat - y_min)
×
DYMAX
(y_max - y_min)
Where x_addat (y_addat) is the A/D converted
value and DXMAX (DYMAX) is the LCD
resolution (number of dots).
A.3 Precautions
A.3.1 Interrupt processing
(1) Only a pen-down interrupt may be generated
when only the pen-down check circuit is
activated (PDC = "1" and RST = "0"). When the
TPC circuit is activated, both the pen-down
and coordinate data update interrupts may be
generated. Therefore, disable the pen-down
interrupt when the TPC circuit is activated.
(2) The coordinate data registers DX0–DX11 and
DY0–DY11 (0FFA8h–0FFABh) must all be read
regardless of the TPC operating status (RST =
"1" or "0"). If only a part of the data, for ex-
ample address 0FFA8h, is read leaving other
addresses, the next coordinate update interrupt
will not be generated.
(3) When a coordinate update interrupt is gener-
ated, the coordinate data registers DX0–DX11
and DY0–DY11 (0FFA8h–0FFABh) must be
read. If the set data is not read, the next
coordinate update interrupt will not be gener-
ated.
A.3.2 Others
(1) A part of or all of the reference flowcharts and
programs may be used freely. However, they
cannot be guaranteed to work. Therefore Seiko
Epson does not assume liability of any kind
arising out of partial or complete use of the
reference flowcharts and programs.
(2) The reference program is a part of an execut-
able program. To execute as a completed
executable program, other processing routines
such as a system initialization are necessary.