STM32 Series 26 - Capacitive Touch Screen

Publisher:CuriousMind123Latest update time:2017-09-22 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Touch screen classification:

  1. Resistive: accurate positioning, single-point touch

  2. Capacitive induction: Capacitive induction: supports multi-touch, but is more expensive. Most widely used in industry

  3. Infrared: Low price, but the frame is fragile, prone to light interference, and distortion on curved surfaces

  4. Surface acoustic wave type: solves various shortcomings, but if there are water droplets and dust on the screen surface, the touch screen will become dull

Note: The touch screen is essentially separated from the LCD. The touch screen is responsible for detecting touch points, while the LCD is responsible for display. Capacitive touch screens generally require a driver IC to detect capacitive touch, and generally output touch data through the IIC interface.

Common driver ICs:

  1. GT9147: 17*10 drive structure (10 sensing channels, 17 drive channels)

  2. OTT2001A: 13*8 drive structure (8 sensing channels, 13 drive channels)

Note: They are connected to the MCU via 4 wires: SDA, SCL, RST and INT.

GT9147:

The IIC address of GT9147 can be 0X14 or 0X5D. Within 5ms after the reset, if INT is high, 0X14 is used as the address, otherwise 0X5D is used as the address. For the specific setting process, please refer to the document: GT9147 Data Manual.pdf. In this chapter, we use 0X14 as the device address (excluding the lowest bit, converted into read and write commands: read: 0X29, write: 0X28)

Control command register (0X8040)

This register can be written with different values ​​to achieve different controls. We generally use the two values ​​0 and 2. Writing 2 can soft reset GT9147. After hard reset, generally write 2 to this register to implement soft reset. Then, write 0 to read the coordinate data normally (and end the soft reset).

Configuration register group (0X8047~0X8100)

There are 186 registers here, which are used to configure the various parameters of GT9147. These configurations are generally provided to us by the manufacturer (an array), so we only need to write the configuration given by the manufacturer into these registers to complete the configuration of GT9147.

Product ID register (0X8140~0X8143)

There are 4 registers here to store product ID. For GT9147, these 4 registers are read as 9, 1, 4, 7 (ASCII code format). Therefore, we can use the values ​​of these 4 registers to determine the model of the driver IC, and thus determine whether it is OTT2001A or GT9147, so as to perform different initializations.

Status Register (0x814E)

We only care about the highest bit and the lowest 4 bits. The highest bit is used to indicate the buffer status. If there is data (coordinates/buttons), the buffer will be 1. The lowest 4 bits are used to indicate the number of valid touch points, ranging from 0 to 5, 0 means no touch, and 5 means 5 touch points.

Coordinate data registers (30 in total)

There are 5 groups (5 points) here, and each group of 6 registers stores data. Take the coordinate data register group of contact 1 as an example. 
Write the picture description here 
We generally only use the x and y coordinates of the contact, so we only need to read the data from 0X8150 to 0X8153, and combine them to get the coordinates of the contact. The other 4 groups are composed of 16 registers starting with 0X8158, 0X8160, 0X8168 and 0X8170, respectively for the coordinates of contacts 2 to 4. Similarly, GT9147 also supports register address self-increment. We only need to send the first address of the register group and then read it continuously. GT9147 will automatically increase the address, thereby increasing the reading speed.


Reference address:STM32 Series 26 - Capacitive Touch Screen

Previous article:STM32 Series No. 27 - Infrared Remote Control
Next article:STM32 Series Chapter 25 - CAN Bus

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号