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 !
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)
//*** 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