The STMPE812A is a 4-wire resistive touchscreen controller with an integrated 4-bit port
expander. The touchscreen controller is designed to be fully autonomous, requiring only
minimal CPU intervention for sampling, filtering and preprocessing operations.
The purpose of this document is to highlight the guidelines and information complementary
to the datasheet that is necessary for a proper operation of the STMPE812A device in
applications.
The first part of the document highlights information on the hardware. This includes external
components/connectivity, power, PCB design and etc.
The second part of the document focuses on information in software in which programming
reference codes are shown. This part is to be used in conjunction with the STMPE812A
software library available in www.st.com.
1.1 Typical application circuit and external components
Figure 1.Typical application schematic
1.65V – 3.6V
1.65V – 3.6V
Y+
Y+
VCC
SDA
SDA
SCL
SCL
INT
INT
RESET
RESET
R1
R1
R2
R2
R3
R3
R4
R4
C1
C1
VCC
RESETN
RESETN
INT (P 2)
INT (P 2)
SCLK
SCLK
SDATA
SDATA
STMPE812A
X+
X+
Y-
Y-
X-
X-
(P1)ADC
(P1)ADC
(P0)ADDR
(P0)ADDR
GND
GND
R5
R5
4-wire
resistive
touchscreen
ADC input
ADC input
Note:1P0 pin is the I
2P1 pin is configurable to GPIO/ADC/PWM (ADC Vin must be less than V
3P2 pin is configurable to GPIO/INT
4Assuming GPIO controlling RESET input is of open drain type
In a typical application, the following external components are required:
●R1: 2.2k-10kΩ pull up resistor at RESET
●R2: 2.2k-10kΩ pull up resistor at INT.
●R3: 2.2k-10kΩ pull up resistor at SCLK
●R4: 2.2k-10kΩ pull up resistor at SDATA
●R5: 2.2k-10kΩ pull up resistor at ADDR
●C1: 100 nF capacitor at V
2
C address bit upon power up or reset and is configurable to GPIO
)
CC
CC
Doc ID 18161 Rev 15/35
AM004192V1
HardwareAN3301
1.2 Power supply
The implementation and layout of the power connection’s section is fundamental for the
correct operation of the STMPE812A touchscreen controller.
The STMPE812A device is equipped with a 12-bit ADC that is used during the touchscreen
controller and auxiliary voltage measurement operations.
The analog blocks require a clean and stable supply voltage in order to operate in optimum
performance. In the STMPE812, the analog blocks and the digital core are supplied by V
The operating V
with the increase in V
voltage range is 1.65 V to 3.6 V. Power consumption will be increased
CC
. The lowest power consumption is at VCC = 1.8 V.
CC
It is a good practice to connect a 0.1
pin.
1.2.1 Power sequence (fail safe)
All GPIOs and sense pins of STMPE812A are NOT fail safe. This means that it is necessary
to make sure that the V
inputs.
All other pins (SCL and SDA) are with fail safe structure. It is possible to turn on the pull-up
supply before V
CC
.
supply to STMPE812A is first turned before driving the GPIO
CC
µF filtering capacitor as close as possible to the V
CC
CC
.
6/35Doc ID 18161 Rev 1
AN3301Hardware
1.3 Power modes transition
The following table highlights the states of touchscreen FIFO, GPIO, Interrupt and PWM
during the various power modes:
–Active mode
–Hibernation mode
–Reset
Table 1.Power modes vs. touchscreen/GPIO/Interrupt/PWM data
DescriptionActive modeHibernation mode
Touchscreen FIFO dataActiveSustainedCleared
GPIO configuration, pin
state and data
Interrupt configuration
and data
PWM configuration and
data
ActiveSustainedCleared
ActiveSustainedCleared
ActiveSustainedCleared
Reset (HW, SW, POR
and General call)
Hibernation mode is entered automatically when ALL of the following listed activities are
met:
●Absent of I
●PWM disabled
●ADC disabled
●Absent of GPIO input transition for 10 ms
●Absent of touchsceen or pen down interrupt for 10 ms
2
C transaction with valid STMPE812A slave address for 10 ms
Doc ID 18161 Rev 17/35
HardwareAN3301
1.4 Touchscreen tracks
The touchscreen tracks (X+, X-, Y+, Y-) are sensitive lines. Noise may be captured by the
touchscreen tracks if the line is too long and if placed nearby noisy lines, for example the
digital data lines and the I2C/SPI lines.
Although there is no recommended standard for track sizes, tracks that are too long reduce
the resolution of the touchscreen controller. As a matter of fact, long tracks introduce a
voltage drop during the measurement cycle at the terminal of the touchscreen panel.
1.4.1 Track resistance
Any track has a certain amount of resistance, thus reducing the effective resolution of the
touchscreen controller.
During the measurement, the current flows to the touchscreen panel through the tracks. If
the resistance is too high, the voltage in the panel terminal is no longer at the same level as
VIO and GND.
From Figure 2 it can be seen that, during the measurement cycle, the device bias the
touchscreen panel with the VIO voltage. Due to the track resistance, the voltage at panel's
terminals is:
Equation 1
VxV
IO
R
R1R2Rx++()⁄⋅=
x
Hence, the effective resolution is reduced by the same factor as well. The track resistance
may be reduced by designing the track as short as possible with a reasonable width.
Figure 2.Track resistance
Tr ack resistance, R1
VIO
To uch panel
Vx
Tr ack resistance, R2
GND
resistance, Rx
8/35Doc ID 18161 Rev 1
AM004193V2
AN3301Hardware
s
1.5 Noise prevention
Noise may be coupled to the tracks connecting the touchscreen and this should be
prevented as much as possible.
Two practices may be applied:
1.Prevent the tracks overlap with other noisy signal tracks, such as I2C/SPI lines and
digital data lines. If the overlap is not avoidable, GND lines separation between
touchscreen lines and noisy lines is recommended (in more than 2 layers PCB).
2. Put GND shielding at each side of touchscreen tracks routing.
Figure 3.Noise prevention
TSC
TSC tracks
Top Layer
1.6 Noise filtering
A filtering capacitor can be placed on the touchscreen tracks to further suppress the noise.
In this case, the best location for the filtering capacitor is as near as possible to the
STMPE812A sense pins (X+, X-, Y+, Y-).
The values recommended for the filtering capacitor are:
1. 1-2 nF for an LCD less than 6 inches
2. 5-10 nF for an LCD bigger than 6 inches
Noisy tracks
Bottom Layer
GNDGND
GND
Oth er
Noisy lin e
AM004194V2
The Settling time and Touch detect delay registers must be set correctly to adapt to the
filtering capacitor, otherwise the touchscreen controller may not work properly. Additional
information is found in the STMPE812A datasheet.
Doc ID 18161 Rev 19/35
HardwareAN3301
1.7 PWM controller
The STMPE812A is integrated with push-pull type of GPIO/PWM outputs. At VCC of 3.3 V,
the outputs are able to provide 8mA of sourcing (out of device) and 12mA of sinking (into
device) current capability. As such, STMPE812A is able to support LED driving in both
sourcing and sinking configuration.
Note: the PWM timing and duty cycle settings in datasheet are based on a LED sourcing
configuration. When used in sinking configuration, the inversion must be executed
accordingly.
Figure 4.PWM LED driving configurations
C u rrent s o urcing
configu ra tion (8 mA)
S TMPE8 12A
S TMPE8 12A
PWM(A1)
PWM(A1)
C u rrent s inking
configu ra tion (12mA)
S TMPE8 12A
S TMPE8 12A
PWM(A1)
PWM(A1)
VCC
VCC
AM004194V1
10/35Doc ID 18161 Rev 1
AN3301Hardware
1.8 ADC controller
The STMPE812A is equipped with a 12-bit analog-to-digital converter (ADC). Besides the
use for ADC conversion during touchsceen controller operation, it is possible to be used as
general purpose ADC conversion for up to maximum two external auxiliary analog signals
feed through pins B2 and C2.
The touchscreen controller has the priority for the ADC conversion. Selection of conversion
of the two external auxiliary analog signals is programmed through Bit[0] of the ADC control
register (0x20).
Whenever the touchscreen data acquisition is initiated, the ADC conversion is triggered
automatically without needs to program the ADC control register. Writing ‘1’ to Bit[6] of ADC
Control register to initialize conversion for Touchscreen data is redundant and will result in
higher current consumption if ADC is in continuous capture mode.
The STMPE812A is integrated with an internal charge pump in order to ensure ADC
performance in low V
ADC control register in the device initialization phase whenever the V
Important: If V
CC
disabled to prevent possible reliability issue or permanent damage of the device.
condition. The internal charge pump should be turned on through
CC
is less than 2.5 V.
CC
is higher than 2.5 V, it is important to ensure the charge pump is
1.9 GPIO output configurations
The STMPE812A provides push-pull type of GPIO output. If open drain GPIO outputs are
required, it is configurable, with a tweak to the software programming routine. See Figure 5,
Figure 6 and Figure 7.
1.9.1 Push-pull
Set the GPIO to output state through PORT_FUNTION (0x04) register. Input path will be
disabled. Output path will be enabled in push-pull configuration.
Figure 5.GPIO push-pull configuration
OUTPUT
INPUT
STMPE812A
disabled
enabled
GPIOxGPIOx
AM004195V1
Doc ID 18161 Rev 111/35
Loading...
+ 24 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.