AN3301 Software
Doc ID 18161 Rev 1 13/35
2 Software
2.1 Touchscreen controller acquisition modes
2.1.1 Data acquisition by internal timer (ACQ_mode “00”)
In this mode, the system configures STMPE812A to sample at a predefined rate (e.g. 10ms)
through TSC_Sampling_Rate register (0x43). On detecting a touch, it starts the sensing
sequence and on completion of sampling (thus data available for reading), it interrupts the
Host. If the Host does not access the data by the time the next data is available, the old data
is overwritten.
Programming sequence:
1. Initialize touchscreen controller
2. Initialize interrupt
3. Wait for interrupt
4. Upon interrupt, read ISR
5. Upon touch data available, read touch data
Figure 8. Data acquisition by internal timer
AM004199V1
Sampling
Touched
No Touch
Initialization
Sampling
Sampling
STMPE812A sens interrupt to Host
Host read ISR
Host read touch data when available
Initialization No Touch Touched No Touch
Sampling
Sampling
Sampling
Agenda:
Software AN3301
14/35 Doc ID 18161 Rev 1
2.1.2 Data acquisition by ACQ command (ACQ_mode “01”)
In this acquisition mode, the STMPE812A merely informs the system host on detecting a
touch. As and when sampling is desired, host issues an “ACQ” command that sets
STMPE812A into a complete sampling cycle. Host may read the data after a period of time,
or poll the interrupt status bit for data availability.
Programming sequence:
1. Initialize touchscreen controller
2. Initialize interrupt (Pen Down mode)
3. Wait for interrupt
4. Upon interrupt, issue ACQ command
5. Poll ACQ bit for data available
6. Upon touch data available, read touch data
Figure 9. Data acquisition by ACQ command
2.1.3 Data acquisition by host read control (ACQ_mode “10”)
The data acquisition by the host read control is the most bandwidth efficient method for
touchscreen interfaces. For 100 Hz sampling with 12-bit X, 12-bit Y, 8-bit Z, only one I
2
C
transaction (5 bytes data read) is required for every 10 ms. Inclusive of overheads, this
translates to approximately 100 bit time.
At 400 kHz I
2
C speed, this is just 2.5% of total bandwidth.
A new sample is taken every time the host reads the previously sampled data. If host reads
the data late, the device simply stays longer in hibernation.
Note: It is necessary to counter check with the data valid bit for each data read.
AM004200V1
Sampling
Touched
No Touch
Initialization
Sampling
Sampling
STMPE812A sens touched interrupt to Host
Host issues ACQ command
Host read touch data when available
Initialization No Touch Touched No Touch
Sampling
Sampling
Sampling
Agenda:
Host polls ACQ bit or ISR for sampling completion
AN3301 Software
Doc ID 18161 Rev 1 15/35
Programming sequence:
1. Initialize touchscreen controller
2. Initialize interrupt (pen down mode)
3. Wait for interrupt
4. Upon interrupt, issue data read (counter check with the embedded data valid bit for the
validity of the corresponding data)
5. Start host timer (typical 10ms depends on the programmed sampling time)
6. Upon time out, issue data read (counter check with the embedded data valid bit for the
validity of the corresponding data)
Figure 10. Data acquisition by host read command
Sampling
Touched
No Touch No Touch
Initialization
STMPE812 sends touched interrupt to Host
Host read touch data
Sampling
Sampling
Agenda:
Sampling
Touched
No Touch No Touch
Initialization
STMPE812 sends touched interrupt to Host
Host read touch data
Sampling
Sampling
Agenda:

STMPE812ABJR

Mfr. #:
Manufacturer:
STMicroelectronics
Description:
Touch Screen Controllers Touchscreen cntrlr S-Touch
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet