![](http://datasheet.mmic.net.cn/100000/IF180C52TXXX-20R_datasheet_3493957/IF180C52TXXX-20R_598.png)
598
32099I–01/2012
AT32UC3L016/32/64
26.7.4
Resistive Touch Screen Sequencer
The Resistive Touch Screen Sequencer is responsible for applying voltage to the resistive touch
screen films as described in
Section 26.7.2. This is done by controlling the output enable and the
output value of the ADP and AD pins. This allows the Resistive Touch Screen Sequencer to add
a voltage gradient on one film while keeping the other film floating so a touch can be measured.
The Resistive Touch Screen Sequencer will when measuring the vertical position, apply VDD
and GND to the pins connected to X
P and XM. The YP and YM pins are put in tristate mode so the
measurement of Y
P can proceed without interference. To compensate for ADC offset errors and
non ideal pad drivers, the actual voltage of X
P and XM is measured as well, so the real values for
VDD and GND can be used in the contact point calculation to increase accuracy. See second
When the vertical values are converted the same setup is applies for the second axes, by setting
X
P and XM in tristate mode and applying VDD and GND to YP and YM. Refer to Section 26.8.3 for details.
26.7.5
Pen Detect
If no contact is applied to the resistive touch screen films, any resistive touch screen conversion
result will be undefined as the film being measured is floating. This can be avoided by enabling
Pen Detect and only trigger resistive touch screen conversions when the Pen Contact
(PENCNT) status bit in the Status Register (SR) is one. Pen Detect is enabled by writing a one
to the Pen Detect (PENDET) bit in the Mode Register (MR).
When Pen Detect is enabled, the ADCIFB grounds the vertical panel by applying GND to X
P and
X
M and polarizes the horizontal panel by enabling pull-up on the pin connected to YP. The YM pin
will in this mode be tristated. Since there is no contact, no current is flowing and there is no
related power consumption. As soon as a contact occurs, GND will propagate to Y
M by pulling
down Y
P, allowing the contact to be registered by the ADCIFB.
A programmable debouncing filter can be used to filter out false pen detects because of noise.
The debouncing filter is programmable from one CLK_ADC period and up to 2
15 CLK_ADC peri-
ods. The debouncer length is set by writing to the PENDBC field in MR.