ST AN2825 Application note

AN2825 Application Note

S-Touch® STMPE811 resistive touchscreen controller advanced features

Introduction

This application note provides details on the advanced features of the S-Touch® STMPE811 touchscreen controllers.

In particular, the STMPE811 device is a GPIO (general purpose input/output) port expander equipped with an advanced touchscreen controller which helps to reduce the load of the host and simplify data processing.

The document is divided into three sections which respectively describe: touchscreen advanced features, available touchscreen controller settings and basic guidelines on the use of interrupts.

September 2011

Doc ID 15023 Rev 1

1/11

www.st.com

Contents

AN2825

 

 

Contents

1

STMPE811 advanced features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

 

1.1

Autonomous operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

 

1.2

FIFO memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

 

1.3

Movement tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4

 

1.4

Averaging data to optimize noise cancellation . . . . . . . . . . . . . . . . . . . . . .

5

 

1.5

Window tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6

2

Settings description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

 

2.1

ADC sample time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

 

2.2

ADC bit mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

 

2.3

ADC clock frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

 

2.4

TSC operating mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

 

2.5

Tracking index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

 

2.6

Averaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

 

2.7

Touch detect delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

 

2.8

Driver settling time delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

3

Interrupt user guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. 9

 

3.1

Touch detect interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

 

3.2

FIFO interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

4

Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10

2/11

Doc ID 15023 Rev 1

ST AN2825 Application note

AN2825

STMPE811 advanced features

 

 

1 STMPE811 advanced features

The touchscreen advanced features such as autonomous operation, movement tracking algorithm to avoid excessive data, a 128-depth FIFO buffer and a programmable active window feature that may be used in applications without increasing the host load.

1.1Autonomous operation

The STMPE811 device is integrated with a hard-wired touchscreen controller, for a 4-wire resistive type touchscreen, able to operate in an autonomous way, and interrupts the connected CPU only when a pre-defined event occurs.

Figure 1. Touchscreen controller block diagram

Movement

 

Switch

and

10/12 bit

and

window tracking

ADC

drivers

 

 

FIFO

 

 

FIFO

Driver

 

and

and

 

interrupt control

switch control

 

 

 

AM00745V1

The STMPE811 touchscreen controller converts the ADC output into digital location data (coordinates) and stores these in a FIFO for system access. This FIFO can be accessed directly by the system as and when needed. This design reduces the system loading and the I2C bus utilization.

1.2FIFO memory

The FIFO memory has a depth of 128 sectors, enough for 128 sets of touch data at maximum resolution (2 x 12 bits). The FIFO can be programmed to generate an interrupt when it is filled to a pre-determined level.

The devices convert the data automatically when a touch is detected. The data is stored in the FIFO memory for the host to read.

The FIFO memory is equipped with a control and status register where the host may refer to it during its operation.

Doc ID 15023 Rev 1

3/11

STMPE811 advanced features

AN2825

 

 

Below is a list of the various status of the FIFO memory reported in the control and status registers (FIFO__CTRL_STA register, address 0x4B):

FIFO overflow:

reports ‘1’ when FIFO memory is full and new data is coming.

FIFO full:

reports ‘1’ when FIFO memory is full.

FIFO empty:

reports ‘1’ when there is no data in FIFO memory.

FIFO threshold trigger:

reports ‘1’ when the number of data in FIFO memory exceeds the number specified by user in FIFO_SIZE register.

In the same register there is 1 bit for the user to put FIFO memory in reset mode by writing 1 to this bit. The data in the FIFO will be flushed when FIFO is in reset mode.

The host needs to read the data in the FIFO memory consistently. For example, in XYZ mode, a single data consists of 3 bytes where X, Y and Z data is included. Hence, each data read transaction must consist of multiples of 3 bytes in length to avoid confusion and data loss.

Please refer to the STMPE811 datasheet for a detailed description of each register.

1.3Movement tracking

The movement tracking feature reduces the number of samples generated by the STMPE811 device. Using this feature, the device will receive only data that satisfies the criteria set by the host.

The system host may select one of the 8 tracking index options: 0, 4, 8, 16, 32, 64, 92 and 127. The value of movement index refers to the native resolution of the ADC, which is 4096 points for full range.

In XY mode, for example, the “127 points” option is selected, valid data form a square that is 127 points in size where the valid data being the center of the square. New data which is inside this box is discarded (not stored in the FIFO memory). If new data is located outside the square, the data is taken and used as the center of new square. This is illustrated in Figure 2 which shows how the tracking index eliminates the data inside the tracking area which is formed in the surrounding of valid data.

Figure 2. Tracking index

In XYZ mode, there is another factor that affects the tracking index function; the Z value. The tracking index algorithm still considers new data inside the tracking area as valid data if the Z value is lower than the previous valid data (pressure of new data is higher than previous valid data).

4/11

Doc ID 15023 Rev 1

Loading...
+ 7 hidden pages