
909
SAM9G45 [DATASHEET]
6438K–ATARM–12-Feb-13
40.10.2
Touch Screen Mode
Writing TSAMOD to “Touch Screen Only Mode” automatically enables the touch screen pins as analog inputs, and
thus disables the digital function of the corresponding pins.
In Touch Screen Mode, the channels 0 to 3 corresponding to the Touch Screen inputs are automatically activated
The remaining channels can be either enabled or disabled by the user and their conversions are performed at the
end of each touch screen sequence.
The resolution is forced to 10 bits, regardless of the LOWRES bit setting.
At each trigger, if the bit PRES in
“TSADCC Mode Register” is disabled, the following sequence is performed to
measure only position.
1.
If SLEEP is set, wake up the ADC cell and wait for the Startup Time.
2.
Close the switches on the inputs X
P and XM during the Sample and Hold Time.
3.
Convert Channel X
M and store the result in TSADCC_CDR1.
4.
Close the switches on the inputs X
P and XM during the Sample and Hold Time.
5.
Convert Channel X
P, subtract TSADCC_CDR1 from the result and store the subtraction result in both
TSADCC_CDR0 and TSADCC_LCDR.
6.
Close the switches on the inputs X
P and XM during the Sample and Hold Time.
7.
Convert Channel Y
P, subtract TSADCC_CDR1 from the result and store the subtraction result in both
TSADCC_CDR1 and TSADCC_LCDR.
8.
Close the switches on the inputs Y
P and YM during the Sample and Hold Time.
9.
Convert Channel Y
M and store the result in TSADCC_CDR3.
10. Close the switches on the inputs Y
P and YM during the Sample and Hold Time.
11. Convert Channel Y
P, subtract TSADCC_CDR3 from the result and store the subtraction result in both
TSADCC_CDR2 and TSADCC_LCDR.
12. Close the switches on the inputs Y
P and YM during the Sample and Hold Time.
13. Convert Channel X
P, subtract TSADCC_CDR3 from the result and store the subtraction result in both
TSADCC_CDR3 and TSADCC_LCDR.
14. If Channel 4 to Channel 7 are enabled, convert the Channels and store result in the corresponding
TSADCC_CDRx and TSADCC_LCDR.
15. If SLEEP is set, sleep down the ADC cell.
The resulting buffer is 16 bits wide and its structure stored in memory is:
1.
X
P - XM
2.
Y
P - XM
3.
Y
P - YM
4.
X
P - YM
5.
AD4 to AD7 if enabled.
The vertical position can be easily calculated by dividing the data at offset 0 (X
P - XM) by the data at offset 1 (YP -
X
M).
The horizontal position can be easily calculated by dividing the data at offset 2 (Y
P - YM) by the data at offset 3 (XP
- Y
M).
if the bit PRES in
“TSADCC Mode Register” is enabled, the following sequence is performed to measure both posi-
tion and pressure.