-
Notifications
You must be signed in to change notification settings - Fork 49
Please help me initialize my ILI9488 display with XPT2046 on ESP32S2 Lolin S2 Mini Board #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
you are passing the wrong "Bus" to the display driver. You need to be passing the |
Working great now, thank you. But now how to properly calibrate the display? Because calling the
Same thing also happen using my ili9341 display, anything I missed? |
reduce the color depth to 16 bit by changing |
What an effort you put on this repo. Just a little suggestion if it's really possible to have a choice to attach the touch IRQ pin instead of just periodically polling the screen since we are using a very slow frameworks. |
LVGL is not written to be able to inject touch input. It is only able to poll for touch input. Well... Not easily anyway, I would have to code in a work around. The functions that process input in LVGL are not exposed in any header files, so they are not public, In order to make it work I would have to make a copy of the functions which would cause an increase in the program size. MCU's have very limited resources. I did provide a function that does allow the polling to work better.
This bypasses the normal mechanics of
and turns it into
You can see where the problem is with the first one. You can end up with a really long time from when input occurs until it gets realized on the display. it can be at least 33 milliseconds later, usually it is longer and depending on how long it takes the user code in the main loop to run you could see a much higher latency. That function bypassed the typical mechanics and keeps reading the indev in a continuous loop so long as there is active input. This places user interaction with the GUI above all other thing in terms of priority. |
I think that And also, my board didn't update the display when I switched the setup to Anyway, what is the proper spi freq to use for this xpt2046 driver? I've used this driver before with vanilla micropython and the driver from Oh ya, once more, is it possible to do the calibration using arduino eSPI touch calibrate function instead, and than just put the result into the |
You cannot use the same calibration numbers from eSPI. They are calculated differently I believe.
I believe that 1 mhz is the speed you need to use for the touch panel. You would need to read the datasheet to find out if that is the case.
not sure what you mean by this.
I would have to check and see if this color depth is supported by your display. It may not be. Give me a few minutes to check on that. |
OK so your display only supports RGB888 when using an SPI Bus. That is quite a bit of additional work that needs to be done with that added byte to not a huge amount of perceived color difference due to the size of the display. |
If you have a mess of widgets and some of those widgets are outside of the viewable area on the display that will activate scrolling. When you scroll the display is when you will really notice a difference with the touch set to high priority vs not having it set. |
I noticed that calling this |
OK the touch calibration should now be fixed. |
I can confirm that touch calibration is working pretty well right now, but the touch orientation seem flipped here and there. Even after the calibration succeed,
I'll try using my ILI9341 board later to see if ithe touch also got messy, I'm a little bit busy right now, gotta post here after getting the test result. |
If you flash your ESP32 at all that is going to erase the stored calibration settings. I will check to see what could be causing the values to not be saved. If the values are working after you calibrate the only way they could work is if they have been saved. The indev driver reads the calibration values from NV memory. the calibration saves the values to the NV memory. I will look into it later on today. It is 4:00 am where I am at so I am going to lay down for a few hours. |
Using ILI9341 my touch now working perfectly fine. Didn't tested on ILI9488 yet, will come back later. Here is the catch:
|
I can peacefully say that same thing happen with my ILI9488 display, it's fully working now. One thing left is the calibration data isn't automatically being saved after the calibration. |
ok so the touch calibration still needs some fine tuning. I am not sure as to why there is an issue with it needing to be rotated and not following the points. I suspect that possibly your touch panel is not connected to the IC properly thus causing a problem. If you can enable the debugging for the touch driver by passing The XPT IC has the be the biggest pain to deal with. Most of the issue stems from it not being connected correctly to the touch panel and the touch panel not being attached to the display properly. I am not sure if I will be able to automatically handle all of the installation related issues that occur with it. I will do my best. I still need to come up with a way to adjust the sensitivity because the panel is resistive a threshold needs to be set for when to register touch, The issue there is it is not a constant level across the entire panel. Typically more pressure is needed as you get to the corners in order to register the same touch pressure. If the threshold is set to align with those corners false input can occur for the center of the display. It's those kinds of things that are the hard ones to deal with. I need to come up with some code that will alter the threshold level as the input gets closer to the center of the screen. Problem there is if the display IC is connected incorrectly or the orientation of the panel to the display is not correct that's going to make things more complicated. |
I do not have a display with one of these touch panels to test with either. So that makes it a bit more challenging. If you are willing to help with the testing end of things I am sure we can get it ironed out. |
I actually own 3 of those ILI9341 and 2 ILI9488, and every single one of them works pretty much like I said before.
On rotation 0°, I can say YES indeed, the console returns the exact value as you said. The touch just flipped at some point on another rotation as I mentioned above. It's a pleasure to help this development as I really need to use it as soon as possible. Let me know anything I need to put on test for further debugging. |
I just made a change to the RGB driver. If you want to test it. It might speed things up a tad depending on how long the copy was taking and if LVGL was bumping the flush ready marker not being set. If LVGL bumping that marker the change should keep it from stalling without yielding. This would make a considerable difference as it would allow another thread to run if threading is being used in MicroPython. |
Recompiled the last update, with the exact same code, now the touch starts unresponsive. Can't say anything about the speed difference. |
I will look at it to see what is going on.... I might have missed removing the lock being acquired somewhere. |
Any update on this Kevin? |
i reverted the changes I made so it should be working again. |
I did leave the alterations I made to the touch driver so perhaps that will work now. |
I'm struggling to find any valid documentation on how to create a config to initialize my setup. I've been trying a couple code from this issues tab but nothing's really works. One yelled 'Bus' object has no attribute 'init'.
Please help!
My code provided below
The text was updated successfully, but these errors were encountered: