Atmel ARM-Based Evaluation Kit AT91SAM9N12-EK AT91SAM9N12-EK Data Sheet

Product codes
AT91SAM9N12-EK
Page of 1104
876
SAM9N12/SAM9CN11/SAM9CN12 [DATASHEET]
11063K–ATARM–05-Nov-13
42.7.9 Pen 
Detect 
Method
When there is no contact, it is not necessary to perform a conversion. However, it is important to detect a contact by
keeping the power consumption as low as possible. 
The implementation polarizes one panel by closing the switch on (X
P
/U
L
) and ties the horizontal panel by an embedded
resistor connected to Y
M
 / Sense. This resistor is enabled by a fifth switch. Since there is no contact, no current is flowing
and there is no related power consumption. As soon as a contact occurs, a current is flowing in the Touchscreen and a
Schmitt trigger detects the voltage in the resistor.
The Touchscreen Interrupt configuration is entered by programming the PENDET bit in the 
If this bit is written at 1, the controller samples the pen contact state when it is not converting and waiting for a
trigger. 
To complete the circuit, a programmable debouncer is placed at the output of the Schmitt trigger. This debouncer is
programmable up to 2
15
 ADC clock periods. The debouncer length can be selected by programming the field PENDBC in
.
Due to the analog switch’s structure, the debouncer circuitry is only active when no conversion (Touchscreen or classic
ADC channels) is in progress. Thus, if the time between the end of a conversion sequence and the arrival of the next
trigger event is lower than the debouncing time configured on PENDBC, the debouncer will not detect any contact.
Figure 42-12. Touchscreen Pen Detect 
The Touchscreen Pen Detect can be used to generate an ADC interrupt to wake up the system. The Pen Detect
generates two types of status, reported in the 
:
the PEN bit is set as soon as a contact exceeds the debouncing time as defined by PENDBC and remains set until 
ADC_SR is read.
the NOPEN bit is set as soon as no current flows for a time over the debouncing time as defined by PENDBC and 
remains set until ADC_SR is read.
Both bits are automatically cleared as soon as the Status Register (ADC_SR) is read, and can generate an interrupt by
writing the 
.
Moreover, the rising of either one of them clears the other, they cannot be set at the same time.
The PENS bit of the ADC_SR indicates the current status of the pen contact.
X+/U
L
X-/U
R
L
R
VDDANA
Y+/L
L
VDDANA
GND
GND
To the ADC
VDDANA
GND
Y-/SENSE
GND
GND
Pen Interrupt
Debouncer
PENDBC
0
1
2
3
4