Chinese 3.5 inch ILI9481 LCD behaving weirdly (vertical flickering banding) - Page 1
Forum section: electronics / projects

author: dmg
author_rank: Regular Contributor
timestamp: February 06, 2021, 06:04:10 pm
content: I'm designing something around a 3.5 inch IPS 480x340 pixel LCD I bought off aliexpress, based on an ILI9481 controler. Specifically this one:https://es.aliexpress.com/item/32837085500.htmlThe pinout is all wrong but I figured that out quickly. I asked the seller and he provided some initialization code and a proper datasheet with the good pinout. I started experimenting with the LCD using TFT_eSPI library and an ESP32 and got it to initialize. However, I always have an issue of vertical banding (along the short 320 pixel axis). See, when displaying large areas of color (for example, the whole screen with a single color) flickering vertical bands appear along the screen, mostly near the top area (top being the furthest away from the flex tab and the controller). These bars spawn the whole colored area and they flicker randomly, slightly varying in saturation. The effect is worse with partially saturated colors where all three subpixels are partially lit, and it normally almost disappears when displaying a primary, fully saturated color (i.e. full red, green or blue) or a mix of two of them, although purple displays banding. The worst is browns and grays.At first I thought it could be main power supply noise but it doesn't seem to be the case. Turns out that the effect depends on the charge pump and regulator settings for the ILI9481., and also on the gamma adjustment. The issue is that I have about 9 different configurations. 4 of them are in tft_eSPI and the remaining 5 appear in the code I got from the seller, apparently specific for my screen model. However, neither of them fixes the issue, and some are even theoretically wrong, not respecting the regulator and charge pump setting rules in the ILI9481 datasheet (mostly due to overvoltage). The effect ranges from horrid with some configs to not so bad. The best config I have comes from the TFT_eSPI library and it's theoretically wrong.Does any of you have experienced such an issue and can guide me on how to adjust the screen for proper operation?

author: WattsThat
author_rank: Frequent Contributor
timestamp: February 06, 2021, 11:34:29 pm
content: The Bodmer library has been out there and stable for a fair amount of time. Not sure how to approach a resolution, the only thing I can think of is to perhaps to compare the initialization code to another code base, the one that comes to mind is the mcu_friend Arduino library by David Prentice. While the library is AVR centric and AFAIK not tested on ESP32, pretty sure it has been tested on the STM32 as supported by the Arduino platform. There are several gamma profiles for the 9481 in his code.https://github.com/prenticedavid/MCUFRIEND_kbv/blob/master/MCUFRIEND_kbv.cppI know Prentice is active on the Arduino (display subsection) and AVR Freaks forums, not sure about Bodmer.

author: dmg
author_rank: Regular Contributor
timestamp: February 07, 2021, 10:18:37 am
content: I tested every single initialization sequence I could find and 256 more "evenly distributed" generated by a quick and dirty python script with no luck (only changing power and gamma settings, though).I tested over the two screens I purchased... I also implemented a ripple filter for the buck converter that generates the 3.3V rail for the screen, with no luck, zero change. The output looked pretty clean already on the scope.I also confirmed that the SPI port has no activity after refreshing a frame.Will post a video soon showing the effect. I'm running out of ideas now...

author: thorn
author_rank: Newbie
timestamp: February 07, 2021, 05:46:54 pm
content: Quote from: dmg on February 06, 2021, 06:04:10 pmCan you please share the datasheet and initialization code that you're been provided? The pinout in the listing looks the same as other displays with ILI948x controllers and 40-pin cables available on aliexpress.

author: strawberry
author_rank: Super Contributor
timestamp: February 07, 2021, 07:23:15 pm
content: Read LCD ID registers

author: dmg
author_rank: Regular Contributor
timestamp: February 08, 2021, 08:17:14 pm
content: Quote from: strawberry on February 07, 2021, 07:23:15 pmILI9481 seems to not have ID registers. I'm 100% sure that the Aliepxpress seller didn't lie, it's actually a 9481. I do read the status and diagnostics results. Everything looks okay except register 0Ah which always has bit D7 set to 0 no matter what I do. That seems to indicate booster fault... happens on both screens I got.Quote from: thorn on February 07, 2021, 05:46:54 pmSure, here you go. This one has the right pinout, which is consistent to ILI9481's pins, and I can confirm it does work.As for the code, here's the sequence I got:Code:#define LCD_ILI9481_CMD LCD_WR_8REG#define LCD_ILI9481_INDEX LCD_WR_8DATA#define delayms delay_ms#define comm_out LCD_WR_8REG#define data_out LCD_WR_8DATA#define Delayms delay_msvoid ILI9481_CMI350IPS_Initial_Code(void){comm_out(0x01); //Soft_reseDelayms(220);comm_out(0x11);Delayms(280);comm_out(0xd0); //Power_Settingdata_out(0x07);//07 VC[2:0] Sets the ratio factor of Vci to generate the reference voltages Vci1data_out(0x44);//41 BT[2:0] Sets the Step up factor and output voltage level from the reference voltages Vci1data_out(0x1E);//1f 17 1C VRH[3:0]: Sets the factor to generate VREG1OUT from VCILVLDelayms(220);comm_out(0xd1); //VCOM Controldata_out(0x00);//00data_out(0x0C);//1A VCM [6:0] is used to set factor to generate VCOMH voltage from the reference voltage VREG1OUT 15 09data_out(0x1A);//1F VDV[4:0] is used to set the VCOM alternating amplitude in the range of VREG1OUT x 0.70 to VREG1OUT 1F 18LCD_ILI9481_CMD(0xC5); //Frame RateLCD_ILI9481_INDEX(0x03); // 03 02comm_out(0xd2); //Power_Setting for Normal Modedata_out(0x01); //01data_out(0x11); //11comm_out(0xE4); //?data_out(0xa0);comm_out(0xf3);data_out(0x00);data_out(0x2a);//1 OKLCD_ILI9481_CMD(0xc8);LCD_ILI9481_INDEX(0x00);LCD_ILI9481_INDEX(0x26);LCD_ILI9481_INDEX(0x21);LCD_ILI9481_INDEX(0x00);LCD_ILI9481_INDEX(0x00);LCD_ILI9481_INDEX(0x1f);LCD_ILI9481_INDEX(0x65);LCD_ILI9481_INDEX(0x23);LCD_ILI9481_INDEX(0x77);LCD_ILI9481_INDEX(0x00);LCD_ILI9481_INDEX(0x0f);LCD_ILI9481_INDEX(0x00);//GAMMA SETTINGcomm_out(0xC0);//Panel Driving Settingdata_out(0x00); //1//00 REV SM GSdata_out(0x3B); //2//NL[5:0]: Sets the number of lines to drive the LCD at an interval of 8 lines.data_out(0x00); //3//SCN[6:0]data_out(0x02); //4//PTV: Sets the Vcom output in non-display area drive perioddata_out(0x11); //5//NDL: Sets the source output level in non-display area. PTG: Sets the scan mode in non-display area.comm_out(0xc6); //Interface Controldata_out(0x83);//GAMMA SETTINGcomm_out(0xf0); //?data_out(0x01);comm_out(0xE4);//?data_out(0xa0);LCD_WR_8REG(0x36);LCD_WR_8DATA(0x8C);comm_out(0x3a);data_out(0x55);comm_out(0xb4);//Display Mode and Frame Memory Write Mode Settingdata_out(0x02);data_out(0x00); //?data_out(0x00);data_out(0x01);Delayms(280);comm_out(0x2a);data_out(0x00);data_out(0x00);data_out(0x01);data_out(0x3F); //3Fcomm_out(0x2b);data_out(0x00);data_out(0x00);data_out(0x01);data_out(0xDf); //DF//comm_out(0x21);comm_out(0x29);comm_out(0x2c);

author: fiim
author_rank: Newbie
timestamp: May 30, 2022, 07:13:27 am
content: Hello. I have the same problem. I couldn't solve it. Were you able to solve it? Maybe it's better to find some other IPS display?

author: PsI-On
author_rank: Contributor
timestamp: March 24, 2023, 02:24:06 pm
content: I also have exactly the same problem with a chinese 3.5" tft ILI9481!Did you discover the problem? Maybe these displays are factory discards?!