ILI9325 LCD Touch with STM32f103c8t6

mephisto000
Fri Dec 21, 2018 8:17 am
Hello everybody, i use the library from Steve,
https://github.com/stevstrong/Adafruit_ … 8bit_STM32

My Pin setup (i use the USB-Port to bring the sketch on the BluePill and use this also as power supply at the moment)

5V 5V Bluepill
3V 3V Bluepill
Grd Grd Bluepill
TFT_RD PA0
TFT_WR PA1
TFT_RS PA2
TFT_CS PA3
TFT_RST PA8
LCD_D0 PB8
LCD_D1 PB9
LCD_D2 PB10
LCD_D3 PB11
LCD_D4 PB12
LCD_D5 PB13
LCD_D6 PB14
LCD_D7 PB15

I have change the Pins/Defitions in Adafruit_TFTLCD_8bit_STM32.h

#define TFT_DATA_SHIFT 8 // take the higher bits/pins 8..15


flyboy74
Fri Dec 21, 2018 9:11 am
In your above connections I see all the needed pins to drive the screen but don’t see any of the pins needed to drive the touch

mephisto000
Fri Dec 21, 2018 10:01 am
The Pins that i need to drive the Touch should be

TFT_WR -> PA0
TFT_RS -> PA1
LCD_D0 -> PB8
LCD_D1 -> PB9

or

TFT_RS -> PA1
TFT_CS -> PA3
LCD_D0 – > PB8
LCD_D1 – > PB9

like in the sketch from Stevestrong
#define XM TFT_RS // 330 Ohm // must be an analog pin !!!
#define YP TFT_CS // 500 Ohm // must be an analog pin !!!
#define XP PB8 //TFT_D0 // 330 Ohm // can be a digital pin here the change to PB8 it was PB0
#define YM PB9 //TFT_D1 // 500 Ohm // can be a digital pin here the change to PB9 it was PB1


mephisto000
Fri Dec 21, 2018 3:21 pm
Hello,

now i have found out with the Multimeter that my Pins not the same like as usual.

My Pins that i have to use are LCD_D6, LCD_D7 and for the control LCD_RS and LCD_WR.

#define XM LCD_RS // 330 Ohm // must be an analog pin !!!
#define YP LCD_WR // 500 Ohm // must be an analog pin !!!
#define XP PB14 //LCD_D6 // 330 Ohm // can be a digital pin
#define YM PB15 //LCD_D7 // 500 Ohm // can be a digital pin


flyboy74
Fri Dec 21, 2018 7:21 pm
Your xm, xp and ym, yp are backwards just swap the definitions around

mephisto000
Sat Dec 22, 2018 10:13 am
I have try all but nothing will happent. Mostly the calibraition will not go further.
The give me no reaction.

I am with my latin to end :-(


stevestrong
Sat Dec 22, 2018 5:30 pm
What exactly have you tried and what happened after each step? Please describe in detail.
I think the touch resolution should also be adapted to your screen resolution.

mephisto000
Sat Dec 22, 2018 9:54 pm
Hello, now i have upload a movie but please do not laugh :-).
But first i have to say thank you both and the community, that you answer and help me.
https://www.youtube.com/watch?v=aOjCTMp … e=youtu.be

Ok, i will explain what i have done….
In the movie you will see the config below

#define XM TFT_RS // 330 Ohm // must be an analog pin !!!
#define YP TFT_WR // 500 Ohm // must be an analog pin !!!
#define XP PB14 //TFT_D6 // 330 Ohm // can be a digital pin
#define YM PB15 //TFT_D7 // 500 Ohm // can be a digital pin


Bear in There
Sat Dec 22, 2018 11:54 pm
The residence is the screen
If you ever read the voltage from a potentiometer, your half way there.

mephisto000
Sun Dec 23, 2018 7:00 am
I’m not sure what you mean.
I think there is something wrong with the x and y axis.
But only a little mistake but didn’t find it.

I use also the Adafruit_TFTLCD_8bit_STM32.h Libary which was adapted by Steve.
Maybe i have to change something there, because my Pin Setup see above.


stevestrong
Sun Dec 23, 2018 8:37 am
Sorry but I didn’t use that code since a very long time, and I don’t know how your sketch looks like.

Here I have found a solution to a similar issue: https://forum.arduino.cc/index.php?topi … msg2560334
G***le is your friend ;)


mephisto000
Sun Dec 23, 2018 4:03 pm
sorry but i did’t find the solution….

I looked in the Link but he had the ordinary Libary from Adafruit and there you can change mapping in the sketch.
He change this Line above and after that it worked. He has only the y value mirror.
p.y = map(p.y, TS_MAXY, TS_MINY, tft.height()-BOXSIZE*2, 0); //Here I changed the values of the MAXY and MINY around.


stevestrong
Mon Dec 24, 2018 8:11 am
OK, I try to test the code again, maybe I can reproduce your problem by swapping some of the pins.

Leave a Reply

Your email address will not be published. Required fields are marked *