RobertoBenjami/stm32_graphics_display_drivers

ILI9486 3.5 inch TFT Problem

Ex1a opened this issue · 17 comments

Ex1a commented

My board is STM32F103C8T6, I use the ILI9341 LCD driver to control the ILI9341 3.5(480*320) touched TFT, but it can not display anything.

Unexpectedly, I use the ILI9486 driver to control the ILI9341, the display function is effective!!, but the touch function does not work.

I used Arduino to test whether the LCD can be touched, I'm sure it can detect the x y coordinates.

Could you help me to solve my problem?

Thank you very much!!

The ILI9341 only knows a resolution of 320x240 pixels, so it sure isn't on the screen. The ILI9486 already knows the 480x320 resolution.
So I can't tell you what's wrong, put up a project somewhere (example github). Show me how you connected the display. Show a link to your display.

Ex1a commented

Thank you for your reply!!

My board pin link to display is as same as your example.
image
image

My project link is as follows:
https://drive.google.com/drive/folders/1GcAsOb5L8-eK8yVAX1rgCi0OcNwECAKC?usp=sharing

I also sent an email to your Gmail account, THANK YOU VERY MUCH!!

I tried your project. I had a touchscreen. Only the redirection of the printf function is missing from the projected, so the touch coordinates do not reach either the uart or the swo pin.

Ex1a commented

Thanks for your testing!!

But the printf function should not affect the operation of the paint program, right?

I cannot draw any point in the paint test program.

Is the swo printf function is necessary?

I will try it tomorrow, thank you!

The paint program does not use printf, but touchcalib does.

Ex1a commented

So my first step is to open the printf function to get the value from the touchclib program.

Then to modify the TS_CINDEX value, is that right?

Thank you!

Yes, you must first generate TS_CINDEX values with tochcalib. These values may differ depending on the display type. It can then be used in the paint program.
Check it out here: https://www.youtube.com/watch?v=qyCctzAbD2g

Ex1a commented

I used the Touchcalib program, but after I clicked the first point, the second point did not appear, is this normal?

I have another question, can I use the live expression to replace uart printf function?

I cannot use SWO because my ST-LINK is the cheap one.

I have read this page
https://lujji.github.io/blog/stlink-clone-trace/
but I am afraid of breaking ST-LINK.

Ex1a commented

I let SWV Enable!
http://eeblog.co.uk/2018/11/29/swo-with-cubemx-using-st-link-clones/

After I pressed the first point, the second point did not appear.
But, SWV TIM Data Console only displays this.
465564

It seems that STM32 has not detected any touch values at all, right?

My display is this
http://www.lcdwiki.com/3.5inch_Arduino_Display-UNO

Do I need to define ADC1 and ADC2 Modes in .ioc?
1
2

What should I do? I'm so confused...

Thank you!

It does not detect the touchscreen.
It is not necessary to set the ADC in the ioc because the LCD_IO_Init contains the ADC initialization.
Are you sure the touch on the screen is good?
You can use a multimeter to measure the resistances of the touchscreen.
I measured this on my display:
D6 - RS: 650 Ohm
D7 - WR: 300 Ohm
D6 - WR: infinite, if I press the surface of the display it is about 1000 Ohm

Ex1a commented

I measure my display(connected to stm32 but not power up), the value is as follows:
RS - D6: 1.7k Ohm(Not touched) 1.5 - 2k Ohm(Touched)
RS - D7: 1.7k Ohm(Not touched) 1.5k - 2k Ohm(Touched)
WR - D6: 160 Ohm(Not touched) 150 - 180 Ohm(Touched)
WR - D7: 160 Ohm(Not touched) 150 - 180 Ohm(Touched)

It seems that my display is different from yours, right?

I tested this display on my Arduino UNO, it can work.

I used the Arduino test program by on this website:
http://www.lcdwiki.com/3.5inch_Arduino_Display-UNO

Thank you!

Then something is wrong. A resistance of a few hundred ohms between RS-D6 (XM-XP) and WR-D7 (YP-YM) is normal. But between the WR-D6 (YP-XP), you can only measure around 1000 Ohms by pressing the touchscreen on the display. We have to measure an infinite value without pressure. I did the measurements without stm32.

Ex1a commented

I measured it again, no wires connected.
WR-D6 cannot be detected in untouched state 20M-50M Ohm(Touched)
WR-D7 cannot be detected in untouched state 30M-50M Ohm(Touched)
RS-D6 cannot be detected in untouched and Touched state, I think this is infinite.
RS-D7 cannot be detected in untouched and Touched state, I think this is infinite.

These values are so strange, is my digital multimeter broken?

Thank you!

This measured resistance is strange. I searched and there are 4 and 5 wire resistive touch screens as well. The driver is designed for 4 wires. Is it possible that there are 5 wires in your display?
https://www.dmccoltd.com/english/museum/touchscreens/technologies/Resistive.asp
Also try putting a breakpoint on ili9486.c line 658 (after if (TS_IO_DetectToch ())). Will you get here?

Ex1a commented

Does 4 wires mean that the display has XM XP YM YP?
If it's right, the code in Arduino test program proves that it has:
5648564465

What is putting a breakpoint? Sorry, my program skill is not very well...
2323
Is it to write break(); on line 658? But this will give an error.

Thank you!

Ex1a commented

I want to buy the new display to solve this strange problem...

I read the sheet on README.md, saying that STM32F1 cannot support SPI and XPT2046.

I have some questions about STM32F103C8T6. Can C8T6 use ILI9486 4-wire SPI interface and XPT2046 touch driver?

like this:
http://www.lcdwiki.com/4.0inch_SPI_Module_ILI9486

Or can you recommend me the display(>3 inch) and can use the touch function?

Thank you very much!!

I added the XPT driver to the F1 family.