Hello.
The board is an OPEN-SMART with ILI9225. (8080-8 parallel interface)
First question. Is it possible to use it with the Lolin32 board (pinout)? It's the only board I have that has enough pins.
Second question. How to make the connections between Lolin32 and the lcd? I didn't find how to set custom pins in the diagnose_TFT_support example from the MCUFRIEND_kbv library.
Thank you in advance,
Daniel
Yes, you connect every pin according to the TTGO R32 D1 board
//################################### ESP32 ##############################
#elif defined(ESP32) //regular UNO shield on TTGO D1 R32 (ESP32)
#define LCD_RD 2 //LED
#define LCD_WR 4
#define LCD_RS 15 //hard-wired to A2 (GPIO35)
#define LCD_CS 33 //hard-wired to A3 (GPIO34)
#define LCD_RST 32 //hard-wired to A4 (GPIO36)
#define LCD_D0 12
#define LCD_D1 13
#define LCD_D2 26
#define LCD_D3 25
#define LCD_D4 17
#define LCD_D5 16
#define LCD_D6 27
#define LCD_D7 14
If your Lolin32 does not have access to these pins, say so.
Edit MCUFRIEND_kbv.cpp file to enable support e.g.
#define SUPPORT_9225 //ILI9225-B, ILI9225-G ID=0x9225, ID=0x9226, ID=0x6813 +380 bytes
David.
Edit. Your link shows RM68130. I have the ILI9225 board that looks like yours. If you really have RM68130 I would appreciate some feedback.
David, thanks! So far, so good. The link says RM68130, but ILI9225 is printed in the back of the lcd.
However, now the problem is the touch screen. I cannot calibrate. I used TouchScreen_Calibr_native, and pasted the results into Touch_shield_new, but it's not working, only a part of the screen, left side, works. On the draw screen (Touch_shield_new), the screen only works in the upper left corner, and draws on the right side of the screen.
Any suggestion?
Thanks
Daniel
Edit: TouchScreen_Calibr_native returns "Not possible to diagnose Touch pins on ARM or ESP32"
My ILI9225 screen is
//MCUFRIEND_kbv ID=0x9225 176 x 220 Open-Smart ILI9225 AIR
const int XP=7,XM=A1,YP=A2,YM=6; //176x220 ID=0x9225
const int TS_LEFT=895,TS_RT=158,TS_TOP=954,TS_BOT=190;
You can just translate my Arduino numbers into the equivalent ESP32.
David.
Hi David,
Did not work. Please watch the videos, maybe you can find out...
Vídeos: Dropbox - File Deleted
Thanks,
Daniel
I ran the Touch Calibration sketch from the v2.9.9-Release
Since the ILI9225 uses the common D6, D7, A1, A2 pins for Touch I did not even have to edit the example sketch.
Here is the relevant output :
*** COPY-PASTE from Serial Terminal:
const int XP=27,XM=15,YP=4,YM=14; //176x220 ID=0x9225
const int TS_LEFT=840,TS_RT=102,TS_TOP=851,TS_BOT=56;
I copied these statements into v2.9.9-Release TouchShield example.
And it did NOT work !!
I copied the calibration into my private copy of TouchShield (which has the option of using a local Touchscreen_kbv.h instead of the Adafruit Touchscreen.h)
The Touch "works" but is a bit flaky.
David.
I created a code to show raw x and y touch values. So, these are the values:
const int TS_LEFT=730,TS_RT=-2830,TS_TOP=640,TS_BOT=-2340;
Updating the values in Touch_shield_new, still not working. Only the left part works (as video 1 in #6).
Other issue. Z is zero when not pressed, but it also zero when pressed! (and sometimes a random negative value when pressed). I mean, in loop(), I get ghost values for x and y, and z=zero when not pressing the screen. Is there a better way to detect the user pressed the screen?
Thanks,
Daniel
Dave, an update.
The code below works just fine:
void loop() {
uint16_t xx, yy;
tp = ts.getPoint();
if(tp.x <= 730 && tp.x >= -2830 && tp.y < 640 && tp.y > -2340) {
Serial.println("tp.x=" + String(tp.x) + " tp.y=" + String(tp.y) + " tp.z=" + String(tp.z));
xx = map(tp.x, 730, -2830, 0, 178);
yy = map(tp.y, 640, -2340, 0, 220);
Serial.println("XX=" + String(xx) + " YY=" + String(yy));
Serial.println();
}
delay (50);
}
It works, and gives raw and converted X and Y values only when pressed. But, if I include this code after the last Serial.println, I get random values each loop:
Serial.println();
tft.drawPixel(xx, yy, 0xF800); // this one
}
Why? I can't draw during loop()?
Thanks,
Daniel
Go on. You MUST always change XM, YP back to output after calling ts.getPoint()
I am surprised that you get any screen output at all.
Yes, touch seems to be sensitive. I suggest that you check for consistency. e.g. get several same getPoint() values before acting on the new "touch"
David.
Do you know any IC that convert 8080 parallel communication to SPI? To be able to use on boards with fewer pins.
Daniel
Go on. You can buy a SPI ILI9225 board. And as far as I remember Bodmer's TFT_eSPI library supports it.
Or I can provide a SPI library for ILI9225.
You can do a SPI to Parallel abortion like the Waveshare ILI9486 does. A bit simpler since Waveshare converts to 8080-16 and you only need 8080-8.
I don't think that any of the SPI ILI9225 boards have a Touch panel.
Your 8080-8 ILI9225 board has a "300 ohm Resistive Touch Panel".
Driving these raw panels is not really suitable for most ARM chips. And probably suspect for some ESP32 pins too.
David.
can i have spi libary for ILI9225 with ESP32
Please post a link to the actual display board that you have bought. e.g. Ebay sale page.
Bodmer's TFT_eSPI library supports it.Dont have support file for ILI9225