ILI9325 LCD Touch with STM32f103c8t6

Working libraries, libraries being ported and related hardware
mephisto000
Posts: 9
Joined: Thu Dec 20, 2018 7:36 pm

ILI9325 LCD Touch with STM32f103c8t6

Post by 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

Code: Select all

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

because i use PB8 - PB15
and

Code: Select all

#define TFT_RST			PA8 // it was PB10
i think thats clear

and the Graphictest runs fantastic but i have to go in the Arduino IDE and open the Serial Monitor. If i didn't do that the code will not start.
If i close the Serial Monitor later the Display stop nearly 3 seconds after.
May you can give me a piece of advice to solve this little Problem.

The second one is i would like to use the Touch Function, but i get no responce from the Display or Serial output.

I have try the tftpaint Sketch from the examples with little changes.

Code: Select all

#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
The Display is a little bit bright (not black) and a small writing in black Fonts says me i have to "Calibration Press one corner..."

If i press the Display nothing happens also i start/open the Serial Monitor but still nothing happened.
In the sketch is this Line

Code: Select all

	delay(6000); // allow time for OS to enumerate USB as COM port
i use this and raised them to 10000 and the Serial Monitor says me

*** Paint demo with easy touch calibration process ***
Found ILI9325 LCD driver
Calibrating the touch surface
> please press one corner...

If i press one or multiple Point on the Display nothing happens.

Now i need help.

In the definition Steve wrote 330 Ohm and 500 Ohm. Is there a Resistor that i need?

Sorry i know my english is not the best but i hope you can understand and help me.

Best regards
Mephisto000

flyboy74
Posts: 231
Joined: Wed Jun 13, 2018 11:02 am

Re: ILI9325 LCD Touch with STM32f103c8t6

Post by 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
Posts: 9
Joined: Thu Dec 20, 2018 7:36 pm

Re: ILI9325 LCD Touch with STM32f103c8t6

Post by 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

Code: Select all

#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
but i think that must be a mistake in the second line (I think it must be #define YP TFT_WR) i don't know.

mephisto000
Posts: 9
Joined: Thu Dec 20, 2018 7:36 pm

Re: ILI9325 LCD Touch with STM32f103c8t6

Post by 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.

Code: Select all

#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
The Display shows me the calibration

I have also to modify the example from SteveStrong in this section.

Code: Select all

tft.println("Press one corner...");
	Serial.println("Calibrating the touch surface");
	Serial.print("> please press one corner...");
  tft.fillRect(244, 0, 5, 5, GREEN);                      // -> i have to chance to   tft.fillRect(234, 0, 5, 5, GREEN);
	ts.calibratePoint();
tft.fillRect(244, 0, 5, 5, BLUE)                          // ->   i have to chache to   tft.fillRect(234, 0, 5, 5, GREEN); ;
because it is a 240x320 Display and the 244 it out of them.

Now i have an other Problem :-)
The Touch is not correct. I will try to explane.

If i go from middle right to middle left the line goes from middle down to middle high and if i go from left to right the line goes from up to down.

flyboy74
Posts: 231
Joined: Wed Jun 13, 2018 11:02 am

Re: ILI9325 LCD Touch with STM32f103c8t6

Post by flyboy74 » Fri Dec 21, 2018 7:21 pm

Your xm, xp and ym, yp are backwards just swap the definitions around

mephisto000
Posts: 9
Joined: Thu Dec 20, 2018 7:36 pm

Re: ILI9325 LCD Touch with STM32f103c8t6

Post by 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
Posts: 3053
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany
Contact:

Re: ILI9325 LCD Touch with STM32f103c8t6

Post by 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
Posts: 9
Joined: Thu Dec 20, 2018 7:36 pm

Re: ILI9325 LCD Touch with STM32f103c8t6

Post by 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

Code: Select all

#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
i have change all settings
as flyboy74 and stevestrong recommended like

Code: Select all

#define YP TFT_RS // 330 Ohm // must be an analog pin !!!
#define XM 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
the caliration goes without my doing to the screen with 8 colors boxes in the top
and the black box blink a little bit like i do touch this.

If i touch the display, no matter in which field, the blinking in the black box stop but i can make no line or everything.

or

Code: Select all

#define XM TFT_RS // 330 Ohm // must be an analog pin !!!
#define YP TFT_WR // 500 Ohm // must be an analog pin !!!
#define XP PB15 //TFT_D6 // 330 Ohm // can be a digital pin
#define YM PB14 //TFT_D7 // 500 Ohm // can be a digital pin
also the caliration goes without my doing to the screen with 8 colors boxes in the top
like same as above

or

Code: Select all

#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
#define YM PB9 //TFT_D1 // 500 Ohm // can be a digital pin
here comes only the screen with the request that i have to push one corner but no response.

i hope you understand me

User avatar
Bear in There
Posts: 31
Joined: Tue Nov 20, 2018 9:30 pm

Re: ILI9325 LCD Touch with STM32f103c8t6

Post by 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.
Good artists copy; great artists steal. (Incorrectly accredited to Pablo Picaso by Steve Jobs)

mephisto000
Posts: 9
Joined: Thu Dec 20, 2018 7:36 pm

Re: ILI9325 LCD Touch with STM32f103c8t6

Post by 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.

Post Reply