
S1C88409 TECHNICAL MANUAL
EPSON
227
APPENDIX: CONTROLLING THE TOUCH PANEL CONTROLLER
A.2 Description
A.2.1 Circuit connection
Refer to Section 5.17, "Touch Panel Controller".
A.2.2 Mask option configuration
Refer to Section 5.17, "Touch Panel Controller".
A.2.3 Reducing power consumption and
improving response
(1) How to reduce power consumption
To reduce current consumption, the high-speed
clock (OSC3) should be used to operate the
touch panel controller (TPC) only while the
touch panel is being used.
The coordinate update interrupt should be
enabled (ETPDR = "1").
When the touch panel is not being used, set the
operating clock to the low-speed clock (OSC1),
turn off the clock supply to the A/D converter
and TPC (PRAD = "0", PRTP = "0"), and reset
the TPC circuit (RST = "0").
Furthermore, enable the pen-down check
circuit (PDC = "1") to check a pen-down, then
reset the pen-down interrupt factor flag
(FTPPD = "1") a set period of time, and then
enable the pen-down interrupt (ETPDR = "1").
When a pen-down interrupt has occurred due
to the first pen-down, switch the operating
clock to the high-speed clock (OSC3) and turn
on the clock supply to the A/D converter and
TPC (PRAD = "1", PRTP = "1"). Then reset the
pen-down check circuit (PDC = "0") and
activate the TPC (RST = "1"). The pen-down
interrupt should be disabled (ETPDR = "0").
After that read the detected coordinate data
every time a coordinate update interrupt has
occurred.
If coordinate data is not updated for a set
period of time, assume that the touch panel is
not being used, and return the configuration to
the standby status for *awaiting the next pen-
down.
Note, however, that the user's first operation
may not be detected in this method because
there is a time lag of several hundred msec
between the first pen-down detection and
when the TPC becomes ready to detect coordi-
nates.
(2) How to improve the response against
user's operation
To improve the response against user's opera-
tion, always activate the TPC with the high-
speed clock (OSC3).
The pen-down check control and pen-down
interrupt should be disabled (PDC = "0",
ETPPD = "0").
Set the operating clock to the high-speed clock
(OSC3), turn on the clock supply to the A/D
converter and TPC (PRAD = "1", PRTP = "1")
and activate the TPC (RST = "1"). The coordi-
nate update interrupt should be enabled after
resetting the coordinate update interrupt factor
flag.
After that read the detected coordinate data
every time a coordinate update interrupt has
occurred due to the user's pen-trace operation.
Note, however, that this method increases
power consumption because the TPC has to
always operate with the high-speed clock.
The sample program described later uses this
method.
(3) How to obtain the intermediate
characteristics
To obtain the intermediate characteristics
between methods (1) and (2), the operating
clock should be always set to the high-speed
clock (OSC3) and the TPC and A/D converter
should be activated after a pen-down is
detected by the pen-down check.
A.2.4 Reading coordinate data from the
TPC
(1) Method 1
Read the detected coordinate data and the
switch status information (DX0–DX11, DY0–
DY11, PEN) and store them in the temporary
area, then set a flag indicating that coordinate
data is updated. The detected coordinate data
and the switch status information is guaran-
teed against change by the hardware until they
are read by software after a coordinate update
interrupt has occurred (they are not rewritten
during read). These processes should be
performed in the coordinate update interrupt
service routine.
Monitor the above flag in the main routine to
check if coordinate data is updated. If the flag
has been set, disable the interrupt and read the
data stored in the temporary area.