STMPE812A: Touchscreen Controller S-Touch With PWM and Dedicated RESET Pin
STMPE812A: Touchscreen Controller S-Touch With PWM and Dedicated RESET Pin
STMPE812A: Touchscreen Controller S-Touch With PWM and Dedicated RESET Pin
Features
■ Integrated 4-wire resistive touchscreen
controller, pen-down/real-time mode, fully-
autonomous
■ 12-bit ADC for high-resolution touchscreen
■ Operating voltage 1.65 - 3.6 V
■ Low power consumption:
– Hibernation mode: 0.5 µA
– Active mode: 100 µA
■ Auto-hibernation and hotkey wake-up features CSP 12
(2.17 x 1.67 mm)
■ Up to 3 GPIOs with alternate functions
– 1 PWM controller
– 1 general purpose 12-bit ADC input Description
– Optional interrupt output pin
The STMPE812A is a 4-wire resistive
■ Dedicated reset input pin touchscreen controller with 4-bit port expander
■ 400 kHz I2C interface integrated.
The touchscreen controller is designed to be fully
■ 8 kV HBM, 1 kV CDM ESD protection on
autonomous, requiring only minimal CPU
X+/X-/Y+/Y-
intervention for sampling, filtering and pre-
■ 2 kV HBM, 250 V CDM ESD protection on all processing operations.
other pins
Applications
■ Portable media players
■ Game consoles
■ Mobile and smart phones
Contents
2 I2C interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1 I2C features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 Data input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3 Read operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4 Write operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3 Power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4 Charge pump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5 Power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
6 STMPE812A registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
6.1 Auto-increment/non auto-increment address . . . . . . . . . . . . . . . . . . . . . . 18
8 Interrupt system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
9 ADC controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
10 PWM controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
10.1 Register map for PWM function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
10.2 Interrupt of PWM controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
11 Touchscreen controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
11.1 Touchscreen controller detection sequence . . . . . . . . . . . . . . . . . . . . . . . 32
11.2 3 modes of acquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
11.3 Touchscreen controller registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
11.4 Programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
13 Electrical specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
13.1 DC electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
13.2 AC electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
15 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Touch X+
VDD Screen X-
Power Drivers and Y+
GND Management Switches Y-
SDA
I2C Interface
SCL
TSC
ADC '0)/!$#07-
M '0)/!$$2
GPIO/PWM U
Controller
X
'0)/).4
2%3%4.
Reset
POR
43# 4OU CHSCREEN CONTROLLER System
!$# !NALOG TO $IGITAL #ONVERTER
!-6
8 9 8
9
! " # $
6## 0 2%3%4.
'.$
! " # $
0 0 3$! 3#,
! " # $
!-6
B3 Y+ 50 mA current limit Y+
C3 X- 50 mA current limit X-
D3 Y- 50 mA current limit Y-
Active low RESET (3.6 V tolerant within VCC valid
+8 mA/-12 mA at
C2 RESETN range). Typical reset filter duration is 788 ns at
3.3 V
1.8 V VCC.
Can be > 80 mA
D2 GND load at touchscreen Ground
and GPIO drive
I2C clock (fail safe, tolerant to 3.6 V regardless of
D1 SCL -4 mA
VCC)
Note: All I/O operates on VCC. All I/O tolerant up to 3.6 V, across VCC = 1.65 - 3.6 V
8 kV HBM ESD on all touchscreen pins (+/- 8 kV vs GND)
0.5 µA max input leakage as input, across VCC range (GPIO, SCL/SDA)
4 µs hardware filter on the 3 GPIOs as input
6
6##
WIRE
).4 0
RESISTIVE
3#, TOUCHSCREEN
34-0% !
3$!
2%3%4. #AN BE USED AS !$# 07- OR '0)/
0
!$$20
'.$
!-6
2 I2C interface
For the bus master to communicate to the slave device, the bus master must initiate a Start
condition and be followed by the slave device address. Accompanying the slave device
address, there is a read/write bit (R/W). The bit is set to 1 for read and 0 for write operation.
If a match occurs on the slave device address, the corresponding device gives an
acknowledge on the SDA during the 9th bit time. If there is no match, it deselects itself from
the bus by not responding to the transaction.
SDA
tR tF
SCL
tHIGH
tSU:DAT tSU:STA tSU:STO
P S tLOW tHD:DAT SR P
AI00589
0 40h
1 41h
Start condition
A Start condition is identified by a falling edge of SDATA while SCLK is stable at high state.
A Start condition must precede any data/command transfer. The device continuously
monitors for a Start condition and does not respond to any transaction unless one is
encountered.
Stop condition
A Stop condition is identified by a rising edge of SDATA while SCLK is stable at high state. A
Stop condition terminates communication between the slave device and the bus master. A
read command that is followed by NoAck can be followed by a Stop condition to force the
slave device into idle mode. When the slave device is in idle mode, it is ready to receive the
next I2C transaction. A Stop condition at the end of a write command stops the write
operation to registers.
Acknowledge bit
The acknowledge bit is used to indicate a successful byte transfer. The bus transmitter
releases the SDATA after sending eight bits of data. During the ninth bit, the receiver pulls
the SDATA low to acknowledge the receipt of the eight bits of data. The receiver may leave
the SDATA in high state if it does not acknowledge the receipt of the data.
R/W=0
R/W=1
No Ack
One byte Device Reg Device Data
Start
Stop
Ack
Ack
Ack
Read Address Address Address Read
No Ack
Restart
R/W=0
R/W=1
Device Reg Device Data
Stop
More than one byte Data Data
Start
Ack
Ack
Ack
Ack
Ack
Read Address Address Address Read Read + 1 Read + 2
Data
R/W=0
Stop
Start
Ack
Ack
Ack
Address Address to be
Write
written
Stop
Data to
Start
Data to
Ack
Ack
Ack
Ack
Ack
Read
Address Address Write Write + 1 Write + 2
Master
Slave
AM04175V1
3 Power supply
The STMPE812A GPIO operates from a supply pin VCC. For better resolution and noise
immunity, VCC above 2.8 V is recommended.
Power up reset
The STMPE812A is equipped with an internal POR circuit that holds the device in reset
state, until the VCC supply input is valid. The internal POR is tied to the VCC supply pin.
4 Charge pump
The STMPE812A is integrated with an internal charge-pump. The charge pump is required
for any ADC/TSC operations when VCC is less than 2.5 V.
Activating the charge pump when VCC > 2.5 V may result in permanent damage of the
device.
5 Power modes
Hibernate:
-PWM/ADC must be “off” (clock disable bit SET)
-Any GPIO input, with interrupt enabled, causes a transition to “active” state, if an input
change is detected.
-Pen down even causes transition to “active” state if the touchscreen controller is enabled.
ACTIVE POR
Soft -Reset, Reset input
I2C activity,
No activity Touch, Hotkey Reset Input
(about 33 μs)
AUTO -
HIBERNATE
STMPE812A is in
active mode if PWM
is running
AM04141V1
On power up reset, device goes to active state. However, as all the functional blocks are
clocked off by default, no touch/hotkey activity is possible. If there are no I2C activities,
device goes into auto-hibernate mode automatically.
The auto-hibernate feature of STMPE812A is always enabled. Whenever there is a period of
inactivity, the device enters this mode to reduce power consumption. On detection a touch,
correctly addressed I2C data, GPIO activity, the device wakes up immediately.
As the device is able to wake up very quickly, there is no loss of touch data.
6 STMPE812A registers
This section lists and describes the registers of the STMPE812A device, starting with a
register map and then provides detailed descriptions of register types.
Registers from 0x20 - 0x2F are accessible only if “ADC_OFF” bit in SYS_CTRL is set to “0”.
0x20 ADC_CTRL 8 R/W 0x33 ADC control
0x21 - 22 ADC_DATA 16 R 0x0000 ADC data
Registers from 0x40 - 0x4F are accessible only if “TSC_OFF” bit in SYS_CTRL is set to “0”.
4-wire touchscreen
0x40 TSC_CTRL 8 R/W 0x00
controller setup
TSC_DET_CFG Touchscreen controller
0x41 8 R/W 0xA4
1 configuration 1
TSC_DET_CFG Touchscreen controller
0x42 8 R/W 0xB0
2 configuration 2
TSC_SAMPLIN Touchscreen controller
0x43 8 R/W 0x0A
G_RATE sampling rate register
0 0 0 0 1 1 1 1
Address: 0x03
Type: R/W
Reset: 0x0F
Description: System control register.
[7] RESERVED
[6] SOFT_RESET
Reset the 812 using serial communication
ALL REGISTER VALUES ARE RESET. State machines all back to POR states.
[5] TSC_EN
Write ‘1’ to enable operation of TSC. Write ‘0’ to disable it.
[4] RESERVED
[3] PWM_OFF
Writing ‘1’ switches OFF the clock supply to PWM
[2] GPIO_OFF
Writing ‘1’ switches OFF the clock supply to GPIO
[1] TSC_OFF
Writing ‘1’ switches OFF the clock supply to touchscreen controller
[0] ADC_OFF
Writing ‘1’ switches OFF the clock supply to ADC
If the clock supply to a particular functional block is turned off, the registers of these
modules are not accessible.
1 1 1 1 1 0 0 0
Address: 0x04
Type: R/W
Reset: 0xF8
Description: Port function control register.
[7:6] PORT 2 FUNCTION
[5:4] RESERVED
[3:2] PORT 1 FUNCTION
[1:0] PORT 0 FUNCTION
Port function:
'00' - GPIO input
'01' - GPIO output
'10' - ADC input (P1 only)
'11' - Special function
Special function for:
P0 - NONE
P1 - PWM
P2 - INT output
0 0 0 0 0 0 0 0
Address: 0x06 - 07
Type: R/W
Reset: 0x00
Description: General purpose scratch pad register. Could be used for testing of serial interface
reliability.
[15:0] SCRATCHPAD
8 Interrupt system
The STMPE812A uses a 2-tier interrupt structure. In normal mode, interrupts from the GPIO
and touchscreen controller assert the INT pin and are available in the Interrupt Status
register (ISR).
In pen down mode, the INT pin is asserted as long as pen down is detected.
Since the INT pin is a OR function of the pen down and all other enabled interrupts, in order
for INT pin to provide the exclusive indication of pen down (INT = Low) and pen up
(INT = High), as such benefit from minimal I2C transactions, it is recommended to use pen
down mode when the GPIO/PWM/ADC functions are not required or the GPIO/PWM/ADC
interrupts are disabled.
0%. $/7. -/$%
!.$
0%. $/7.
)NTERRUPT
4OUCHSCREEN STATUS
STATUS
07-'0)/ ACTIVITY
).4 PIN
/2
!.$
)NTERRUPT
ENABLE
!-6
0 0 0 0 0
Address: 0x08
Type: R/W
Reset: 0x00
Description: This register is used to enable the interruption from a system related interrupt source
to the host.
[7] INT_MODE:
‘0’ for Pen-Down INT mode (INT pin asserted as long as pen down detected). Nothing can de-
assert the INT pin as long as PEN is down. TSC_TOUCH in INT_EN register must be enabled
for PEN_DOWN interrupt to operate.
If any other interrupt sources are enabled, the INT output is:
PEN_STATUS OR OTHER_INT
INT_E setting is not required for PEN-DOWN mode. It is recommended Pen-Down INT mode
enabled in applications where GPIO/ADC/PWM functions or interrupts are not in used, such
that the INT pin signal provides the exclusive indication for pen down and pen up.
‘1’ for normal INT mode (INT pin asserted if any bit in INT STATUS REGISTER is set)
When INT_MODE is changed, all interrupt status are cleared. Pending INT output (if any) is
cleared too.
[6:3] RESERVED
[2] INT_ POLARITY:
‘1’ for active high/rising edge
‘0’ for active low/falling edge
Interrupt pin should be pulled to VCC if “active low” polarity is used, and pulled to GND if “active
high” polarity is used.
[1] INT_TYPE:
‘1’ for edge interrupt (pulse width = 50-150 µs)
‘0’ for level interrupt
Edge interrupt does not work in PEN_DOWN INT mode
This bit is ignored in PEN_DOWN INT mode.
[0] GLOBAL_INT:
‘1’ allows global interrupt
‘0’ stops all interrupt
This bit overwrites INT_MODE: If global_int is stop (in pen down INT_MODE), even pen down
does not generate an interrupt.
0 0 0 0 0 0 0 0
Address: 0x09
Type: R/W
Reset: 0x00
Description: This register is used to enable the interruption from a system related interrupt source
to the host.
[7] TSC_ERR
Error encountered in coordinate calculation in touchscreen controller
[6] TSC_RELEASE:
Release of TSC is detected
[5] P2:
Port 2 activity (GPIO)
[4] RESERVED
[3] P1
Port 1 activity (GPIO/ADC/PWM)
[2] P0
Port 0 activity (GPIO)
[1] TSC_DATA
Touch data available
[0] TSC_TOUCH
Touch is detected
Note: * Hotkey interrupt should have respond time of <5 µs in active mode and less than 1 ms in
hibernate mode.
0 0 0 0 0 0 0 0
Address: 0x0A
Type: R
Reset: 0x00
Description: ISR register monitors the status of the interruption from a particular interrupt source
to the host. Regardless whether the INT_EN bits are enabled, the ISR bits are still
updated.
Writing to this register has no effect. Reading the register clears any asserted bit
Implementation: A shadow register MUST be used to ensure that Read+Clear action
DOES NOT clear up any bit that is not READ.
Note: Reading the Interrupt Enable Register also clears the ISR. It is recommended that no read operation on IER
to be executed during normal operation. IER should only be accessed during initialization.
[7] TSC_ERR
Error encountered in coordinate calculation in TSC, or touch detect not valid after sampling
[6] TSC_RELEASE:
Release of touch is detected
[5] P2
Port 2 activity (GPIO)
[4] RESERVED
[3] P1
Port 1 activity (GPIO/ADC/PWM)
[2] P0
Port 0 activity (GPIO)
[1] TSC_DATA
Touch data available. In internal timer and host-read controlled mode, this bit can only
be cleared after the data has been read by the host. In ACQ mode, this bit is cleared after the
data or the ISR is read by the host.
[0] TSC_TOUCH
Touch is detected.
(In PEN-DOWN interrupt mode, this bit is never cleared until pen is removed)
In PEN_DOWN interrupt mode, this status register will still be updated with event interrupt
status data, and cleared on read. However no interrupt will be issued based on this status
register.
9 ADC controller
A 12-bit ADC is integrated in the STMPE812A. The ADC could be used as generic analog-
digital converter, or a touchscreen controller capable of controlling a 4-wire resistive
touchscreen.
The ADC works ONLY with internal reference (equal to VCC), always 12 bit.
0 0 1 1 0 0 1 1
Address: 0x20
Type: R/W
Reset: 0x33
Description: This register is used to configure the ADC operations.
[7] ADC_MODE: ADC capture mode
‘0’ – Continuous capture according to sampling rate specified by ADC_FREQ register. New
data over-writes old data in ADC_DATA register.
‘1’ – One-shot capture. One sample is taken every time system writes ‘1’ to ADC_CAP bit
[6] ADC_CAP: ADC channel data capture
In one-shot mode:
Write ‘1’ to initiate data acquisition for the corresponding channel. Writing ‘0’ has no effect.
Reads ‘1’ if conversion is in progress.Reads ‘0’ if conversion is completed.
One-shot mode ADC generates interrupt in corresponding interrupt status bit on completion of
conversion
In continuous capture mode:
Write ‘1’ to initiate data acquisition for the corresponding channel. Writing ‘0’ to stop capturing.
[5:4] ADC_FREQ: ADC sampling frequency based on 1MHz RC (minimum 880 KHz)
00 – 10 K samples/sec
01 – 12.5 K samples/sec
10 – 15 K samples/sec
11 – 20 K samples/sec
NOTE: As the ADC is also used for TSC operation. This setting affects the maximum sampling
rate possible with TSC.
[3] CP_Arm: Writing ‘1’ arms the charge-pump for unlocking
Writing ‘0’ un-arms it
Charge-pump is required for ADC/TSC operation when VCC is less than 2.5 V. Activating the
charge pump when VCC is more than 2.5 V may result in permanent damage of the
device.
Charge-pump can be activated by unlocking CP_Lock after it is armed.
[2:1] CP_Lock[1:0]: Only effective if CP_Arm is set to ‘1’.
Always reads ‘00’.
Writing ‘01’ when CP_Arm is ‘1’ activates the charge pump.
Writing ‘00’, ‘10’ and ‘11’ does NOT activate the charge-pump, and clears the CP_Arm bit.
CP_Arm MUST BE set before writing to CP_Lock. Accesses to CP_Lock will be ignored, if
CP_Arm is ‘0’.
Note: CP_Arm and CP_Lock CANNOT be accessed in a single I2C transaction. System must
first ARM the CP with 1 I2C transaction, and unlocks it in the next. CP_LOCK reads “00”
if charge pump is activated
CP_LOCK reads “01” if charge pump is not activated
[0] RESERVED
0 0 0 0 0 0 0 0
Address: 0x21-0x22
Type: R
Reset: 0x0000
Address: ADC data register.
[7:0] ADC_DATAx
Note: When the I2C master accesses the data register, upper/lower byte consistency must be
guaranteed (once access starts, content will only be updated after BOTH bytes has been
read, OR I2C master accesses other register address):
- 0x21 is LSB
- 0x22 is MSB
10 PWM controller
0 0 0 0 0 0 0 0
Address: 0x50
Type: R/W
Reset: 0x00
Description: PWM clock divider register.
[7:5] BurstLength[2:0]
Burst length of PWM output
‘000’ – 8 ms
‘001’ – 16 ms
‘010’ – 32 ms
‘011’ – 64 ms
‘100’ – 128 ms
‘101’ – 256 ms
‘110’ – 512 ms
‘111’ – 1024 ms
[4:0] Div[4:0]
PWM controller is based on 600KHz clock divided by (Div[4:0] + 1).
Effectively, PWM clock is:
600 KHz (MAX)
600 KHz/32 = 18.75 KHz (MIN)
0 0 0 0
Address: 0x51
Type: R/W
Reset: 0x00
Description: PWM control1 register.
[7:4] This defines the of the PWM channel output which in turn determines the brightness level of
the LED that the PWM output drives. Note that this is assuming LED is connected in SINKING
MODE. System host should program the brightness in a reverse way if sourcing configuration
were to be used.
0000: duty cycle ratio 1:15 (6.25%, minimum brightness)
0001: duty cycle ratio 2:14 (12.50%)
0010: duty cycle ratio 3:13 (18.75%)
0011: duty cycle ratio 4:12 (25.00%)
0100: duty cycle ratio 5:11 (31.25%)
0101: duty cycle ratio 6:10 (37.50%)
0110: duty cycle ratio 7: 9 (43.75%)
0111: duty cycle ratio 8: 8 (50.00%)
1000: duty cycle ratio 9: 7 (56.25%)
1001: duty cycle ratio 10: 6 (62.50%)
1010: duty cycle ratio 11: 5 (68.75%)
1011: duty cycle ratio 12: 4 (75.00%)
1100: duty cycle ratio 13: 3 (81.25%)
1101: duty cycle ratio 14: 2 (87.50%)
1110: duty cycle ratio 15: 1 (93.75%)
1111: duty cycle ratio 16: 0 (100.00%, maximum brightness)
[3:2] BurstMultiplier
PWM output continues for time = BurstLength * BurstMultiplier
*If BurstMultiplier = 0, PWM output indefinitely (until PWM is turned OFF)
1 Off_State
‘0’ : PWM Output “HI” when PWM not running
‘1’ : PWM Output “LOW” when PWM not running
0 Enable
Writing ‘1’ to this bit starts the PWM controller sequence
Writing ‘0’ has stops it
Reads ‘1’ when PWM is running.
11 Touchscreen controller
The STMPE812A is integrated with a hard-wired touchscreen controller for 4-wire resistive
type touchscreen. The touchscreen controller is able to operate completely autonomously,
and would interrupt the connected CPU only when pre-defined event occurs.
The TSC is based on an internal 20Ksamples/sec ADC, running off a 1 MHz (minimum
880 kHz) RC OSC.
Sampling time = touch detect delay*2 + (settling time + (ADC conversion time*MAV) ) *3
BIT
CH !$#
-(Z
MAX
MINIMUM +
+ SAMPLESS AT -(Z
2# /3#
43# TIMING GENERATOR
43# SAMPLING RATE
MS
MS
!-6
0 0 0 0
Address: 0x40
Type: R/W
Reset: 0x00
Description: Touchscreen control register.
[7:5] MAV_MODE[2:0]
‘000’ – MAV filter disabled
‘001’ – 6 remove 2
‘010’ – 8 remove 4
‘011’ – 10 remove 2
‘100’ – 12 remove 4
‘101’ – 20 remove 4
‘110’ – 4 remove none (equal to 4 x oversampling)
‘111’ – 8 remove none (equal to 8 x oversampling)
[4] ACQ
Only valid in acquisition mode ‘01’ (acquisition initiated by system host writing to ACQ bit)
Writing ‘1’ to this bit initiates a TSC data acquisition
Writing ‘0’ has no effect
Reads ‘1’ if data acquisition is in progress
Reads ‘0’ if data is ready
If Data is already available in buffer and not read by system host, setting this bit to ‘1’ renders
the data in buffer “invalid”. DATA available bit in Interrupt Status register is reset by hardware
automatically. Pending interrupt due to DATA available (if any) is cleared.
Data pointer in multi-byte read operation is reset when this bit is written to.
[3:2] Precharge[1:0]
Pre-charge driver for touch detection
‘00’ – no pre-charge
‘01’ – 2 µs pre-charge
‘10’ – 4 µs pre-charge
‘11’ – 8 µs pre-charge
[1:0] Current Limit [1:0]
Current limit of touchscreen driver
‘00’ – 5 mA
‘01’ – 10 mA
‘10’ – 20 mA
‘11’ – 30 mA
1 0 1 0 0 1 0 0
Address: 0x41
Type: R/W
Reset: 0xA4
Description: Touchscreen controller detection configuration 1 register.
[7:6] PenStrength[1:0]
Pen detect strength threshold
‘00’ – least sensitive (50 K pull-up)
‘01’ – sensitive (40 K pull-up)
‘10’ – more sensitive (30 K pull-up) - Default
‘11’ – most sensitive (20 K pull-up)
[5:3] TDetDly[2:0]
Touch detect delay
‘000’ = 40 µs
‘001’ = 80 µs
‘010’ = 160 µs
‘011’ = 320 µs
‘100’ = 640 µs - Default
‘101’ = 1.28 ms
‘110’ = 2.56 ms
‘111’ = 5.12 ms
[2:0] Settling[2:0]
Panel driver settling time
‘000’ = 40 µs
‘001’ = 80 µs
‘010’ = 160 µs
‘011’ = 320 µs/ns
‘100’ = 640 µs - Default
‘101’ = 1.28 ms
‘110’ = 2.56 ms
‘111’ = 5.12 ms
For large panels (> 6 inches), a capacitor of 10 nF is recommended at the touchscreen
terminals for noise filtering. In this case, settling time of 1 ms or more is recommended.
1 0 1 1 0 0 0 0
Address: 0x42
Type: R/W
Reset: 0xB0
Description: Touchscreen controller detection configuration 2 register.
[7:6] Acq_Mode
‘00’ – Data acquisition timed by internal timer
‘01’ – Data acquisition triggered by a write to “ACQ” bit
‘10’ – Data acquisition using Host-Controlled Sampling Rate Control. (Default)
‘11’ – Reserved
In mode ‘10’, device sample a complete data set every time host accesses the buffer. After
completion of sampling, device enters hibernate mode, until data is accessed again. (Or PEN-
UP causing interrupt to de-assert)
[5] StatusRead
‘1’ inserts data valid (data available) status read in data port. (Default)
Reading data port in this mode clears the ISR register (equivalent to accessing interrupt status
register)
‘0’ – no data valid (data available) status access by data port
[4] OpMode
TSC operating mode
‘0’ for 12-bit X,12-bit Y,8-bit Z acquisition
‘1’ for 12-bit X, 12-bit Y only (Default)
0 0 0 0 1 0 1 0
Address: 0x43
Type: R/W
Reset: 0x0A
Description: Touchscreen controller sampling rate control register.
[7:0] Sampling[7:0]
Sets the sampling rate of touchscreen controller.
Sampling Time = (sampling[7:0]+1) in ms
Clock cycle = 1 µs (1 MHz RC OSC)
Sampling time = 1 ms – 256 ms
NOTE:
This is used as “TSC regular initiator signal’. As long as there remains a valid touch, every
interval of this timing, the touchscreen controller executes a complete drive/settling/multi-
sample/MAV/data calculation. It is the user’s responsibility to choose a sampling time that is
enough, based on ADC_FREQ, settling time and filter.
0 0 0 0 0 0 0 0
Address: 0x42
Type: R/W
Reset: 0xB0
Description: The data format of the touchscreen controller data register depends on the setting of
“OpMode” field in the touchscreen detection configuration 2 register. The samples
acquired are accessed in “packed samples”. The size of each “packed sample”
depends on which mode the touchscreen controller is operating in.
[7:0] TSC_DATA_x: Data byte from touchscreen controller.
Note: In order to preserve the integrity of the data, it is mandatory to ensure the following:
- System host to read exactly the number of bytes according to the programmed operating
mode
- I2C host to insert a STOP condition after each data read command
Data pointer in this 1-level buffer could be reset by:
-User issued ACQ in user initiated acquisition mode. In mode ‘10’, every time sampling is
completed, it overwrites the buffer, and reset the data pointer
[3:0] of X
0 0 4 [11:4] of X [7:0] of Y [7:0] of Z
[11:8] of Y
[3:0] of X
1 0 3 [11:4] of X [7:0] of Y -
[11:8] of Y
7 6 5 4 3 2 1 0
RESERVED DATA VALID RESERVED
[7:2] RESERVED
[1] DATA VALID
1: Touch data available/valid
0: Touch data not available/not valid
Bit reset upon read
[0] RESERVED
Data Valid Status Read in data port is useful together with Pen Down mode whereby
accessing the ISR is not needed so as to achieve the best I2C bandwidth efficiency (i.e.
minimal I2C transactions).
Note: Reading the Data valid Status byte also clears the ISR.
Note: If one set of data is available in buffer, and not accessed by the I2C host, yet the sampling
timer is up for the next data, the STMPE812A samples the next data as scheduled.
If old data is still NOT accessed when new data is ready to be written to the buffer, it is over-
written.
If old data is IN PROGRESS of being accessed, new data is DISCARDED.
If I2C host accessed PART OF the data, and moved on to read ANY OTHER REGISTER
LOCATION, the existing data is CONSIDERED READ, and new data ready to be written into
buffer
The STMPE812A samples a new data set immediately after every complete read.
If the host does not complete a data-set read, no further samples are taken.
For each data point (4 bytes), number of I2C transaction required is:
A: read Data Valid Status (1 byte), read data (4 bytes)
B: write ACQ (1 byte), read ACQ (1 byte), read data (4 bytes)
C: read (4 bytes)
A total of 3 configurable ports are available in the STMPE812A port expander device.
If configured as GPIO input/output, they are controlled by the GPIO registers.
Bit 7 6 5 4 3 2 1 0
GPIO monitor pin state Reading this bit yields the current state of the bit. Writing has no effect.
Writing ‘1’ to this bit causes the corresponding GPIO to go to ‘1’ state.
GPIO set pin state Writing ‘0’ to this bit has no effect
Reading this register always yield 0x00
Writing ‘1’ to this bit causes the corresponding GPIO to go to ‘0’ state.
GPIO clear pin state Writing ‘0’ to this bit has no effect
Reading this register always yield 0x00
Writing ‘1’ to this bit allows interrupt generation when there is a falling
GPIO falling edge detection edge at the corresponding GPIO
enable
Writing ‘0’ disables the interrupt generation on falling edge detection
Writing ‘1’ to this bit allows interrupt generation when there is a rising
GPIO rising edge detection edge at the corresponding GPIO
enable
Writing ‘0’ disables the interrupt generation on rising edge detection
If both GPFE and GPRE are not set, state transition on a GPIO does not cause an interrupt.
On power-up reset, all GPIO are set as input.
13 Electrical specification
VCC = 1.8 V
TSC running at 100 sets
– 100 120
of X/Y per second
MAV disabled
ICC max Operating current µA
Vcc=1.8V
TSC Running at 100 sets
– 230 280
of X/Y per second
MAV 6 remove 2
VCC= 3.3 V
TSC running at 100 sets
– 670 810
of X/Y/Z per second
MAV 10 remove 2
ICC max Operating current µA
Vcc=1.8 V
TSC running at 100 sets
– 470 570
of X/Y/Z per second
MAV 10 remove 2
VCC = 1.8 V
TSC running at 100 sets
ICC max Operating current – 870 1050 µA
of X/Y/Z per second
MAV 20 remove 4
VCC = 3.3 V
TSC running at 100 sets
ICC max Operating current – 1190 1430 µA
of X/Y/Z per second
MAV 20 remove 4
Max
I2C maximum SCLK VCC = 1.65 - 3.6 V – – 400 KHz
ClkI2C
Minimum RESET pulse
TRESET 4 – – µS
width
Minimum INPUT width
TIN required for GPIO state 4 – – µS
transition
Internal RC OSC
Fosc VCC = 1.65 - 3.6 V 900 1200 1500 KHz
frequency
AM00745V1
' )DENTIFICATION FOR
(ALOGEN FREE
)DENTIFICATION FOR
DEVICE FRONT
END 6-.
AND BACK
END PLANT 977 )DENTIFICATION FOR
TRACEABLE DATE CODE
!-6
15 Revision history
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the
right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any
time, without notice.
All ST products are sold pursuant to ST’s terms and conditions of sale.
Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no
liability whatsoever relating to the choice, selection or use of the ST products and services described herein.
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this
document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products
or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such
third party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED
WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS
OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
UNLESS EXPRESSLY APPROVED IN WRITING BY TWO AUTHORIZED ST REPRESENTATIVES, ST PRODUCTS ARE NOT
RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING
APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY,
DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE
GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER’S OWN RISK.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void
any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any
liability of ST.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.