Accessing Touch Panel resistors of a TFT Display

2.4″ TFT DISPLAY TOUCH PANEL RESISTANCE TERMINALS  
How to find and use them (FOR NON ARDUINO USERS)

Chinese made TFT Display !  You can not get any support, but low cost compensates that. Here is the help !

2.4″ TFT ekran, dokunmatik

Terminals of two touch sensor resistors, one in X other in Y direction are connected to 4 pins of screen. These pins are shared with TFT display signals. Life is easier for Arduino users who just plug and go with “Arduino compliant” products.

Whereas, non Arduino users like me have to find out which pins are used on their TFT TP.  Since I am a STM32 user, I had to find out my own way.  I share it below for interested ones. Hope that will be helpful for someone.

Values of the X and Y resistors of TP (Touch Panel) film are in the range of 300 to 700 ohms. When you touch the screen, these resistors look like two potentiometers connected to each other via their middle (sliding) terminals. In that case you can use end terminals of X potentiometer to access middle terminal of Y potentiometer, and to access middle terminal of X terminal we use end terminals of Y potentiometer.

How to find out which pin pairs of TFT display are used for this purpose,

Notice: This guideline is for 8 Bit parallel interface TFT screens. Not for displays with SPI interface.

It is simple :

Measure resistances between each pin and other pins one by one using a multimeter. Normally you will measure values in the range of mega ohms. When you find the correct pin pair (terminals of X or Y resistors) you will measure 300 to 700 Ohms. Then you got it, just note the IDs’ of two pin pairs! Smaller one belong to the narrower direction and bigger one belong to wider direction. In Arduino compatible TFT Displays you will find one terminal of each resistor on one of the control pins (CS,RS,WR,RD) and other terminal on one of the D0..D7 pins.

Now you found them, how to use it, it will be long to explain, I will just share heading portion of my code which is explanatory enough – I hope so.

PIN CONNECTIONS FOR STM32

It contains data on pins of TFT and pins of my STM32 chip.

//===== 2.4″ 8b parallel input TFT Data pins ==========//

//8 Parallel inputs :

//TFT_P_D0 TPY+   PB8      (Touch panel shared pin)

//TFT_P_D1 TPX+   PB9      (Touch panel shared pin)

//TFT_P_D2             PB10

//TFT_P_D3             PB11

//TFT_P_D4             PB12

//TFT_P_D5             PB13

//TFT_P_D6             PB14

//TFT_P_D7             PB15

//*** TP and Control pins of ILI9341 2.4″ 8 bit paralel input TFT display *** //

//TFT_P_RST               connected to 3V3, but better to drive together uC RST.

//TFT_P_D1    TPX+     PB9    Always Output, apply “1”  when measuring TP_X

//TFT_P_D0    TPY+     PB8    Always Output, apply “1”  when measuring TP_Y

//TFT_P_CS   TPX_M   PA1  Input of ADC1 when measuring TP_Y,  apply “0” when measuring TPX

//TFT_P_RS   TPY_M   PA0   Input of ADC2 when measuring TP_X, apply ”0” when measuring TPY

//TFT_P_WR   PB1

//TFT_P_RD    PA4

End of this publication – Selçuk Özbayraktar April 2018

3 Replies to “Accessing Touch Panel resistors of a TFT Display”

    1. OK. Henüz Github’a koymamıştım. Biraz toparlıyayım sizi haberdar ederim. Kodlara biraz daha açıklama/comment eklemem lazım. Ayıklanması gereken biraz da çöp kod var. Zaten Github’a koymakta da o yüzden geciktim.
      Birkaç gün müsade istiyorum.

      Selamlar.

      Selçuk

    2. Adem Bey şöyle yapalım.

      Kodları düşündüğümden daha erken paylaşabileceğim ama bir deneme yapmak istiyorum.

      Ben de ilk defa github üzerinden veri paylaşacağım ve ilk denemeyi sizinle yapalım. Kodları github’a koydum aşağıdaki linke tıklayarak ulaşabilirsiniz.

      https://github.com/sozbayraktar/TFT-Touch-with-STM32F103

      Açılan sayfadaki “clone/download” butonuna basarak “USER” klasörünü indirebilmeniz gerekiyor. Bu klasör içinde dokunmatik fonksiyonları ve fazlasını bulacaksınız.

      KEIL MDK5 proje dosyaları ile ST nin Standard Peripheral Driver kütüphanelerini buraya koymadım, bunları kendi geliştirme platforumunuz için yaratıp kütüphaneyi de elde edebileceğinizi düşünüyorum. Zira github çok büyük paketlerin yüklenmesine izin vermiyor.

      Sonuçdan beni haberdar ederseniz mutlu olurum.

      Selamlarımla

      Selçuk Özbayraktar

Comments are closed.