-
Notifications
You must be signed in to change notification settings - Fork 43
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
ILI9341 driver and MSP2401/MSP2402 displays #25
Comments
Quote " I assume that the unmodified code works well for the Adafruit display " Just a note to say my Chinese module purchased on Amazon - CNBTR Red 2.8"" SPI TFT LCD Touch Panel Serial Port Module With PBC ILI9341 Support Serial SPI Mode - So if any mods to the code to select a model type should not just be Adafruit or MSP240z as that would confuse other ILI9341 users like me :-) |
Good point. So what about |
The problem with display drivers is that often there are different ways of connecting the driver chip to the display, with a need for matching code differences. FWIW I have used the driver with Chinese modules - but evidently sources differ. Please could you try the ILI9486 driver docs and code. This is a very minimal driver which does the rotation in code rather than in the chip. This driver works with my Chinese ILI9341 displays. I would be interested to hear the outcome. |
The driver works – but the displayed image is mirrored, both in landscape and portrait orientation and for usd=True and usd=False. With the following patch the displayed image looks fine:
|
Thank you for testing. I have pushed updates to
|
Playing with an ESP32 module, micro-gui and a Chinese ILI9341 module as documented here: http://www.lcdwiki.com/2.4inch_SPI_Module_ILI9341_SKU:MSP2402 , I got quite distorted images on the display. For the values of constructor parameters of class ILI9341 width=320, height=240, usd=False, the display shows this when the "aclock" example is running:
With width=320, height=240, usd=True:
With width=240, height=320, usd=False:
With width=240, height=320, usd=True:
The "skew" of the circle in the third and forth images let me suspect that the "column address" setting, ILI9341 command 0x2A, and/or "page address" (as called in the data sheet – should be "row address" or "row number range" in my understanding...), ILI9341 commad 0x2B, could be off by 1, so I tried this patch:
This patch fixes the "skew". Example for the parameters width=240, height=320, usd=False:
The "noisy parts" of the display still remain, and the proper selection of landscape/portrait orientation still does not work. This can be fixed by changing the parameters for the ILI9341 command 0x36, "Memory Access Control":
The display now looks as expected. Parameters width=320, height=240 usd=False:
width=320, height=240 usd=True:
width=240, height=320 usd=False:
width=240, height=320 usd=True:
I do not (yet) submit a pull request for these simple changes since I assume that the unmodified code works well for the Adafruit display. Would it make sense to add another parameter to ILI9341.init() like "module_type" that could be either "Adafruit" or "MSP240x" that would select between the original parameters and my variants?
While trying to find the right values for the command 0x36, I noticed that it is quite easy to display mirrored images; Just flip bit 7. I don't have any personal use case for a mirrored display but just in case somebody can need it: What about adding another parameter "mirrored=False" to ILI9341.init()?
The text was updated successfully, but these errors were encountered: