robertoj Posted December 8, 2024 Posted December 8, 2024 Hello, I have a new LCD which I believe is an ili4988 (although the vendor says ili9486 and st7796) https://www.aliexpress.us/item/3256803856059047.html I have read somewhere, that I can use an ili9341 spi driver, only by changing the resolution and changing the initialization script. I looked in the waveshare website and github, they don't have anything for the ili9488 Then, I found some arduino code in http://www.lcdwiki.com/3.5inch_SPI_Module_ILI9488_SKU%3AMSP3520 (look for the "3.5 inch SPI Module Package(ILI9488)" link, then find the LCDWIKI_SPI.cpp The initialization sequence is in line 1697: Spoiler 0xF7, 4, 0xA9, 0x51, 0x2C, 0x82, 0xC0, 2, 0x11, 0x09, 0xC1, 1, 0x41, 0xC5, 3, 0x00, 0x0A, 0x80, 0xB1, 2, 0xB0, 0x11, 0xB4, 1, 0x02, 0xB6, 2, 0x02, 0x22, 0xB7, 1, 0xC6, 0xBE, 2, 0x00, 0x04, 0xE9, 1, 0x00, 0x36, 1, 0x08, 0xE0, 15, 0x00, 0x07, 0x10, 0x09, 0x17, 0x0B, 0x41, 0x89, 0x4B, 0x0A, 0x0C, 0x0E, 0x18, 0x1B, 0x0F, 0xE1, 15, 0x00, 0x17, 0x1A, 0x04, 0x0E, 0x06, 0x2F, 0x45, 0x43, 0x02, 0x0A, 0x09, 0x32, 0x36, 0x0F, 0x11, 0, TFTLCD_DELAY8, 120, 0x29, 0 I am currently trying to convert it to a DTS-format init string, so that it fits my ili9341-fb.dts, which I made earlier this year: Spoiler /* OrangePi Zero 3 -> ILI9341 LCD connections SPI CLOCK = PH6 SPI DO (LCD MISO) = PH8 (OPIZ MISO) SPI DI (LCD MOSI) = PH7 (OPIZ MOSI) LCD DATA/CONTROL = PC7 * LCD RESET = PC14 * could be any GPIO pin I want CHIP SELECT = PH9 VCC = 3.3V PIN 17 GND = GND PIN 20 */ /dts-v1/; /plugin/; /{ compatible = "allwinner,sun50i-h616"; /*what is the H618*/ fragment@0 { target = <&pio>; __overlay__{ display_pins: display_pins { pins = "PC7", "PC14"; /* reset, DC pins, order does not matter*/ function = "gpio_out", "gpio_out"; }; }; }; fragment@1 { target = <&spi1>; __overlay__ { /* needed to avoid dtc warning */ #address-cells = <1>; #size-cells = <0>; status="okay"; pinctrl-names = "default"; pinctrl-0 = <&spi1_pins>; /* Mux the PI to make sure they are set in spi Mode */ cs-gpios = <&pio 7 9 0>; /* PH9 chip select, H=7 */ num-chipselects = <1>; display: display@0 { /*compatible = "adafruit,yx240qv29","ilitek,ili9341";*/ compatible = "ilitek,ili9341"; reg = <0>; pinctrl-names = "default"; pinctrl-1 = <&display_pins>; spi-max-frequency = <40000000>; rotate = <270>; /* rotate for ili9341, rotation for yx240qv29 */ bgr=<0>; fps = <15>; buswidth = <8>; height = <640>; width = <320>; reset-gpios = <&pio 2 14 1>; /* PC14 reset pin*/ dc-gpios = <&pio 2 7 0>; /* PC7 Data control pin */ debug = <3>; init = <0x10000b0 0x00 0x1000011 0x20000ff 0x100003a 0x55 0x1000036 0x28 0x10000c2 0x44 0x10000c5 0x00 0x00 0x00 0x00 0x10000e0 0x0f 0x1f 0x1c 0x0c 0x0f 0x08 0x48 0x98 0x37 0x0a 0x13 0x04 0x11 0x0d 0x00 0x10000e1 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00 0x10000e2 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00 0x1000036 0x28 0x1000011 0x1000029>; }; }; }; __overrides__ { rotate = <&display>,"rotate:0"; fps = <&display>,"fps:0"; debug = <&display>,"debug:0"; }; }; I am unsure how to start the init line, can someone help me? Then, when I have that init string confirmed, I can use: https://github.com/notro/panel-mipi-dbi/wiki https://blog.csdn.net/CNflysky/article/details/125171176 To switch to the mipi-dbi driver, which would get me DRM (instead of FB) 0 Quote
robertoj Posted December 8, 2024 Author Posted December 8, 2024 If you want to help, the datasheet PDF is in the lcdwiki download link in the previous post I converted the arduino byte sequence into this: Spoiler init = < 0x10000F7 0xA9 0x51 0x2C 0x82 //adjust control 3 0x10000C0 0x11 0x09 //power control 1 0x10000C1 0x41 //power control 2 0x10000C5 0x00 0x0A 0x80 //voltage common control 0x10000B1 0xB0 0x11 //frame rate control 0x10000B4 0x02 //display inversion control 0x10000B6 0x02 0x22 //display function control 0x10000B7 0xC6 //entry mode set 0x10000BE 0x00 0x04 //HS lanes control 0x10000E9 0x00 //set image function 0x1000036 0x08 //memory access control 0x10000E0 0x00 0x07 0x10 0x09 0x17 0x0B 0x41 0x89 0x4B 0x0A 0x0C 0x0E 0x18 0x1B 0x0F //PGAMCTR positive gamma control 0x10000E1 0x00 0x17 0x1A 0x04 0x0E 0x06 0x2F 0x45 0x43 0x02 0x0A 0x09 0x32 0x36 0x0F //NGAMCTRL negative gamma control 0x1000011 //sleep out command 0x1000029>; //display on The 4.0 inch ILI9488 starts up with RGB noise (non moving) in the left 3/4 of the screen, and a blurry, noisy image in the right 1/4 of the screen. There's a TFTLCD_DELAY8, 120, which I don't know how to insert in the DTS, and the original ili9341-fb.dts has a 0x20000ff, which I don't know whether I need it in the ili9488 init string I inserted the: 0x10000b0 0x00 //interface mode control 0x1000011 //sleep out 0x20000ff //no idea At the beginning, and there is no effect I have no idea about the parameters buswidth, bgr, regwidth... what do they mean? When I added regwidth=<16> (as shown in https://forum.armbian.com/topic/16536-35-screen-ili9486xpt2046-with-kernel-5914-sunxi/) I have a white-grayish screen When I change it to regwidth=<24> I get the same RGB noise as without this parameter When I swap the numbers in height and width like this: height = <320>; width = <640>; I get the RGB noise in the left 3/4 of the screen, but the noisy desktop image (partial) in the top right corner of the LCD I HAD A BIG TYPO: not 640, should be 480 height = <480>; width = <320>; Now, all the screen is mostly black, showing garbled text lines, then a garbled desktop on the top 2/3 of the screen Changing the buswidth to 18 had no effect... I changed the regwidth=16 (made it worse) and txbuflen=32768 (no effect), as seen in https://4pda-to.translate.goog/forum/index.php?showtopic=1041048&st=40&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp Using the ili9486 driver as suggested here: https://github.com/notro/fbtft/issues/582 gave me a white screen 0 Quote
robertoj Posted December 8, 2024 Author Posted December 8, 2024 Changin the parameter Interface Pixel Format (3Ah) to 0x55 (DPI=DBI=55=16 bits/pixel FIXED THE COLORS Insert this after 0x20000ff (I still have no idea what it is for) 0x100003a 0x55 //pixel format. DBI=DPI=16bits per pixel (from ili9341 init) Now, the problem is that the desktop image is reversed left to right... I changed the memory access control to vertical refreshed order direction=1 0x1000036 0x28 //memory access control (was 0x08 in arduino code) No effect, still reversed left to right (or up down if I rotated 180) Is there any difference if this parameter is written twice in the original ili9341 init byte sequence? Ok, it was register B6h Display function control. The bit SS shift direction control was set to 1 in the arduino INO, but it needs to be 0 Change 0x10000B6 0x02 0x22 //display function control 0x10000B6 0x02 0x02 //display function control (2nd param SS shift direction was 0x22 from arduino code) Also, change the rotate DTS parameter from 270 to 90 and the spi speed to 60 MHz Display works correctly in FBTFT mode... but not DRM yet, and not merged with the ADS7846 function (touch screen) 0 Quote
robertoj Posted December 9, 2024 Author Posted December 9, 2024 Posting the FBTFT DTS only... while I am having trouble merging it with ads7846: Spoiler /* OrangePi Zero 3 -> ILI9341 LCD connections SPI CLOCK = PH6 SPI DO (LCD MISO) = PH8 (OPIZ MISO) SPI DI (LCD MOSI) = PH7 (OPIZ MOSI) LCD DATA/CONTROL = PC7 * LCD RESET = PC14 * could be any GPIO pin I want CHIP SELECT = PH9 VCC = 3.3V PIN 17 GND = GND PIN 20 */ /dts-v1/; /plugin/; /{ compatible = "allwinner,sun50i-h616"; /*what is the H618*/ fragment@0 { target = <&pio>; __overlay__{ display_pins: display_pins { pins = "PC7", "PC14"; /* reset, DC pins, order does not matter*/ function = "gpio_out", "gpio_out"; }; }; }; fragment@1 { target = <&spi1>; __overlay__ { /* needed to avoid dtc warning */ #address-cells = <1>; #size-cells = <0>; status="okay"; pinctrl-names = "default"; pinctrl-0 = <&spi1_pins>; /* Mux the PI to make sure they are set in spi Mode */ cs-gpios = <&pio 7 9 0>; /* PH9 chip select, H=7 */ num-chipselects = <1>; display: display@0 { /*compatible = "adafruit,yx240qv29","ilitek,ili9341";*/ compatible = "ilitek,ili9341"; //compatible = "ilitek,ili9486"; reg = <0>; pinctrl-names = "default"; pinctrl-1 = <&display_pins>; spi-max-frequency = <60000000>; //txbuflen = <32768>; rotate = <90>; /* rotate for ili9341, rotation for yx240qv29 */ bgr=<1>; fps = <15>; buswidth = <8>; regwidth = <8>; height = <480>; width = <320>; reset-gpios = <&pio 2 14 1>; /* PC14 reset pin*/ dc-gpios = <&pio 2 7 0>; /* PC7 Data control pin */ debug = <3>; init = < 0x10000b0 0x00 //interface mode control 0x1000011 //sleep out command 0x20000ff //no idea what this does 0x100003a 0x55 //pixel format. DBI=DPI=16bits per pixel (from ili9341 init) 0x10000F7 0xA9 0x51 0x2C 0x82 //adjust control 3 0x10000C0 0x11 0x09 //power control 1 0x10000C1 0x41 //power control 2 0x10000C5 0x00 0x0A 0x80 //voltage common control 0x10000B1 0xB0 0x11 //frame rate control 0x10000B4 0x02 //display inversion control 0x10000B6 0x02 0x02 //display function control (2nd param SS shift direction was 0x22 from arduino code) 0x10000B7 0xC6 //entry mode set 0x10000BE 0x00 0x04 //HS lanes control 0x10000E9 0x00 //set image function 0x1000036 0x08 //memory access control 0x10000E0 0x00 0x07 0x10 0x09 0x17 0x0B 0x41 0x89 0x4B 0x0A 0x0C 0x0E 0x18 0x1B 0x0F //PGAMCTR positive gamma control 0x10000E1 0x00 0x17 0x1A 0x04 0x0E 0x06 0x2F 0x45 0x43 0x02 0x0A 0x09 0x32 0x36 0x0F //NGAMCTRL negative gamma control 0x1000011 //sleep out command 0x1000029>; //display on }; }; }; __overrides__ { rotate = <&display>,"rotate:0"; fps = <&display>,"fps:0"; debug = <&display>,"debug:0"; }; }; Ok, now I was able to merge the ads7946 function: Spoiler roberto@orangepizero3:~/ili9341$ cat ili9488-ads7846.dts /dts-v1/; /plugin/; / { compatible = "allwinner,sun50i-h616"; fragment@0 { target = <&spi1>; __overlay__ { status = "okay"; cs-gpios = <&pio 7 9 0>,<&pio 2 15 0>; //PH9=CS0 for lcd, PC15=CS1 for touch. ili9488: ili9488@0 { compatible = "ilitek,ili9341"; reg = <0>; pinctrl-names = "default"; spi-max-frequency = <60000000>; rotate = <90>; bgr = <1>; fps = <15>; buswidth = <8>; regwidth = <8>; height = <480>; width = <320>; reset-gpios = <&pio 2 14 1>; // PC14 dc-gpios = <&pio 2 7 0>; // PHC7 debug = <3>; init = < 0x10000b0 0x00 //interface mode control 0x1000011 //sleep out command 0x20000ff //no idea what this does 0x100003a 0x55 //pixel format. DBI=DPI=16bits per pixel (from ili9341 init) 0x10000F7 0xA9 0x51 0x2C 0x82 //adjust control 3 0x10000C0 0x11 0x09 //power control 1 0x10000C1 0x41 //power control 2 0x10000C5 0x00 0x0A 0x80 //voltage common control 0x10000B1 0xB0 0x11 //frame rate control 0x10000B4 0x02 //display inversion control 0x10000B6 0x02 0x02 //display function control (2nd param SS shift direction was 0x22 from arduino code) 0x10000B7 0xC6 //entry mode set 0x10000BE 0x00 0x04 //HS lanes control 0x10000E9 0x00 //set image function 0x1000036 0x08 //memory access control 0x10000E0 0x00 0x07 0x10 0x09 0x17 0x0B 0x41 0x89 0x4B 0x0A 0x0C 0x0E 0x18 0x1B 0x0F //PGAMCTR positive gamma control 0x10000E1 0x00 0x17 0x1A 0x04 0x0E 0x06 0x2F 0x45 0x43 0x02 0x0A 0x09 0x32 0x36 0x0F //NGAMCTRL negative gamma control 0x1000011 //sleep out command 0x1000029>; //display on }; ads7846: ads7846@1 { compatible = "ti,ads7846"; reg = <1>; pinctrl-names = "default"; spi-max-frequency = <1000000>; interrupt-parent = <&pio>; interrupts = <2 10 2>; // PC10 - IRQ pendown-gpio = <&pio 2 10 1>; // PC10 // OPTIONS ti,x-min = /bits/ 16 <0>; ti,y-min = /bits/ 16 <0>; ti,x-max = /bits/ 16 <0xFFF>; ti,y-max = /bits/ 16 <0xFFF>; ti,pressure-min = /bits/ 16 <0>; ti,pressure-max = /bits/ 16 <0xFFF>; ti,x-plate-ohms = /bits/ 16 <400>; ti,swap-xy = <1>; }; }; }; }; WARNING: when the touchscreen is touched, a horizontal band (about 8mm) gets color-inverted around the cursor. Lowering the SPI speed does not help it ^ Does anybody have any idea why this is happening? It is bugging me horribly and the color-inversion is lasting until a whole screen refresh and it could stand garbled while doing nothing in lightdm+openbox... is this coming from the touch chip interrupts, or from the cursor animation? Would it go away with the panel-mipi-dbi-spi driver? Next step is to use the panel-mipi-dpi-spi driver as shown here: https://github.com/notro/panel-mipi-dbi/wiki , https://forums.raspberrypi.com/viewtopic.php?t=358240&hilit=Ili9341#p2165638and https://blog.csdn.net/CNflysky/article/details/125171176 0 Quote
robertoj Posted December 10, 2024 Author Posted December 10, 2024 My efforts to use the panel-mipi-dbi-spi driver: DTS Spoiler roberto@orangepizero3:~/mipi-dbi$ cat mipi-ili9488-ads7846.dts /dts-v1/; /plugin/; / { compatible = "allwinner,sun50i-h616"; fragment@0 { target = <&spi1>; __overlay__ { status = "okay"; cs-gpios = <&pio 7 9 0>,<&pio 2 15 0>; /*PH9=CS0 for lcd, PC15=CS1 for touch. Trying <0> instead of <&pio 7 9 0> */ panel: panel@0 { compatible = "panel-mipi-dbi-spi"; reg = <0>; spi-max-frequency = <40000000>; width-mm=<84>; height-mm=<56>; reset-gpios = <&pio 2 14 0>; // PC14 dc-gpios = <&pio 2 7 0>; // PHC7 write-only; debug = <3>; panel-timing { hactive = <480>; vactive = <320>; hback-porch = <0>; vback-porch = <0>; clock-frequency = <0>; hfront-porch = <0>; hsync-len = <0>; vfront-porch = <0>; vsync-len = <0>; }; }; ads7846: ads7846@1 { compatible = "ti,ads7846"; reg = <1>; pinctrl-names = "default"; spi-max-frequency = <1000000>; interrupt-parent = <&pio>; interrupts = <2 10 2>; /* PC10 - IRQ */ pendown-gpio = <&pio 2 10 1>; /* PC10 */ /* OPTIONS */ ti,x-min = /bits/ 16 <0>; ti,y-min = /bits/ 16 <0>; ti,x-max = /bits/ 16 <0xFFF>; ti,y-max = /bits/ 16 <0xFFF>; ti,pressure-min = /bits/ 16 <0>; ti,pressure-max = /bits/ 16 <0xFFF>; ti,x-plate-ohms = /bits/ 16 <400>; ti,swap-xy = <1>; }; }; }; }; Init sequence panel-mipi-dbi-spi.txt Spoiler command 0xB0 0x00 #interface mode control command 0x11 #sleep out command command 0x3A 0x55 #interface pixel format. DBI=DPI=16bits per pixel (from ili9341 init) command 0xF7 0xA9 0x51 0x2C 0x82 #adjust control 3 command 0xC0 0x11 0x09 #power control 1 command 0xC1 0x41 #power control 2 command 0xC5 0x00 0x0A 0x80 #voltage common control command 0xB1 0xB0 0x11 #frame rate control command 0xB4 0x02 #display inversion control command 0xB6 0x02 0x02 #display function control command 0xB7 0xC6 #entry mode set command 0xBE 0x00 0x04 #HS lanes control command 0xE9 0x00 #set image function command 0x36 0x28 #memory access control command 0xE0 0x00 0x07 0x10 0x09 0x17 0x0B 0x41 0x89 0x4B 0x0A 0x0C 0x0E 0x18 0x1B 0x0F #PGAMCTR command 0xE1 0x00 0x17 0x1A 0x04 0x0E 0x06 0x2F 0x45 0x43 0x02 0x0A 0x09 0x32 0x36 0x0F #NGAMCTRL command 0x11 #sleep out command delay 120 command 0x29 #display on compile and install this init command byte sequence (I don't know how to use an arbitrary bin file in the DTS😞 ./mipi-dbi-cmd panel-mipi-dbi.bin panel-mipi-dbi-spi.txt sudo cp panel-mipi-dbi.bin /lib/firmware/ Make sure that the DTS was given to the kernel: look for "Applying user provided DT overlay mipi-ili9488-ads7846.dtbo" without errors before starting kernel Make sure that the panel-mipi-dbi.bin was read by the driver: dmesg|grep mipi , look for no errors like "No config file found for compatible 'ili9488-init,panel-mipi-dbi-spi' (error=-2)" Successfully loaded driver should look lije this: roberto@orangepizero3:~$ dmesg|grep mipi [ 5.690191] panel-mipi-dbi-spi spi1.0: supply power not found, using dummy regulator [ 5.690338] panel-mipi-dbi-spi spi1.0: supply io not found, using dummy regulator [ 5.713936] [drm] Initialized panel-mipi-dbi 1.0.0 20220103 for spi1.0 on minor 2 [ 6.205598] panel-mipi-dbi-spi spi1.0: [drm] fb0: panel-mipi-dbid frame buffer device The panel-mipi-dbi-spi driver in Linux 6.7.12.has the parameters described in: https://elixir.bootlin.com/linux/v6.7.12/source/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml Upgrading to Linux 6.11+ has more parameters, like BGR666 color format https://elixir.bootlin.com/linux/v6.12.4/source/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml The panel-mipi-dbi-spi wiki: https://github.com/notro/panel-mipi-dbi/wiki This is what I get so far I think I need to upgrade to Linux 6.12 and experiment with other "Memory Access Control 0x36" bit values in panel-mipi-dbi-spi.txt 0 Quote
Solution robertoj Posted December 13, 2024 Author Solution Posted December 13, 2024 THANKS TO USER KungFuPancake, who showed me his github repo, where he indicates to use the latest Armbian-edge, and provides the a command byte sequence for the ili9488 https://github.com/KungfuPancake/v0_ips_touch_display?tab=readme-ov-file If you see inverted colors, edit the panel-mipi-dbi-spi.txt and comment the line #command 0x21 before using the mipi-dbi-cmd If you have the cheap chinese clone LCD (see first post), use this DTS (change the gpio codes as needed): Spoiler roberto@orangepizero3:~/mipi-ili9488/v0_ips_touch_display$ cat orangepi-zero3-ads7846.dts /dts-v1/; /plugin/; / { compatible = "allwinner,sun50i-h616"; fragment@0 { target = <&spi1>; __overlay__ { status = "okay"; cs-gpios = <&pio 7 9 0>,<&pio 2 15 0>; // PH9=CS0 for lcd, PC15=CS1 for touch panel: panel@0 { compatible = "panel-mipi-dbi-spi"; reg = <0>; spi-max-frequency = <40000000>; width-mm=<84>; height-mm=<56>; reset-gpios = <&pio 2 14 0>; // PC14 dc-gpios = <&pio 2 7 0>; // PHC7 write-only; format = "b6x2g6x2r6x2"; panel-timing { hactive = <480>; vactive = <320>; hback-porch = <0>; vback-porch = <0>; clock-frequency = <0>; hfront-porch = <0>; hsync-len = <0>; vfront-porch = <0>; vsync-len = <0>; }; }; ads7846: ads7846@1 { compatible = "ti,ads7846"; reg = <1>; pinctrl-names = "default"; spi-max-frequency = <1000000>; interrupt-parent = <&pio>; interrupts = <2 10 2>; /* PC10 - IRQ */ pendown-gpio = <&pio 2 10 1>; /* PC10 */ /* OPTIONS */ ti,x-min = /bits/ 16 <0>; ti,y-min = /bits/ 16 <0>; ti,x-max = /bits/ 16 <0xFFF>; ti,y-max = /bits/ 16 <0xFFF>; ti,pressure-min = /bits/ 16 <0>; ti,pressure-max = /bits/ 16 <0xFFF>; ti,x-plate-ohms = /bits/ 16 <400>; ti,swap-xy = <1>; }; }; }; }; 0 Quote
robertoj Posted December 14, 2024 Author Posted December 14, 2024 Is anyone getting a jumpy cursor, and garbled image around the areas of window refresh? (only at times of touching the screen) I suspect it is caused by sharing the SPI bus with the ads7846 (XPT2040)... anyone knows? I don't have this issue when I use the USB mouse. I also experience the LCD going 3/4 black and frozen, when there are no input events. It restores to normal when I touch the screen or move the mouse (with a white washout/flash in the LCD). My app is continuosly painting pixels, and it happens after a few minutes of no input events. I already have: xset s off & xset s noblank xset s -dpms But it seems that I don't have "xset" installed in my debian bookworm. Fixed with apt install x11-xserver-utils 0 Quote
robertoj Posted March 5 Author Posted March 5 I found that you can rotate the ili9488 display 180 degrees, by changing the LCD initialization command in panel-mipi-dbi-spi.txt: Change: command 0x36 0xE0 To: command 0x36 0x20 (changes memory access control row and column order from: starting from the corner near the VCC pin, to starting from the corner opposite from the VCC pin) Then, open /usr/share/X11/xorg.conf.d/99-calibration, and add: Option "InvertX" "1" Option "InvertY" "1" Reference: https://focuslcds.com/wp-content/uploads/Drivers/ILI9488.pdf https://forums.raspberrypi.com/viewtopic.php?t=173993 I hope it helps someone, or to myself in the future 0 Quote
le51 Posted March 5 Posted March 5 Hi @robertoj, it's really interesting.. For now I just can get my ili9488 display working exclusively on a RBPi using JUJ's fbcp https://github.com/juj/fbcp-ili9341 Tell me if I resume well: You got the display to work with the old fbtft driver, but touch seems unsure You're using the tinydrm and it's fully functionnal What is your kernel version ? 0 Quote
robertoj Posted March 5 Author Posted March 5 (edited) I have the ili9488 working in orange pi zero 3 with my DTS in https://forum.armbian.com/topic/47971-driving-the-ili9488-lcd-40-inch-cheap-chinese-clone/#findComment-208446 and the panel-mipi-dbi-spi.txt from https://github.com/KungfuPancake/v0_ips_touch_display?tab=readme-ov-file My DTS file uses the new panel-mipi-dbi-spi driver, which is not fbtft, it is tinydrm. Kernel 6.12, built from https://github.com/NickAlilovic/build I can use X11 completely fine, but I havent tried wayland and h264 acceleration yet. Can you try it? The only problems I see: Cursor has some "jumpiness" when pressing the touch panel (ads7846). Graphic pixel noise appears when I am dragging an X11 window with finger. But it returns to normal after the dragging event. (doesn't happen when I drag with USB mouse). I think the noise won't happen if I can make a separate soft-SPI for the touch function. Has anybody tried xrandr? I learned to use it in my laptop, but I don't have my orange pi zero 3 available. Can anyone try: $ xrandr --output SPI-1 --rotate left Then replace left with: inverted, right and normal This should take care of the touch at the same time, but someone needs to try it. Edited Saturday at 12:17 AM by robertoj 0 Quote
le51 Posted Saturday at 11:21 PM Posted Saturday at 11:21 PM Hi, sorry for the delay. On 3/5/2025 at 7:22 PM, robertoj said: My DTS file uses the new panel-mipi-dbi-spi driver, which is not fbtft, it is tinydrm. I can't believe it ! This is just great. I will give it a try the next few days. Many thanks 0 Quote
robertoj Posted Monday at 03:50 AM Author Posted Monday at 03:50 AM I had time to test xrandr with my ili9488 and mipi-dbi-spi while the LCD is showing X11+lightdm+openbox, I logged in via SSH and typed: roberto@orangepizero3:~$ DISPLAY=:0.0 xrandr -q xrandr: Failed to get size of gamma for output default Screen 0: minimum 480 x 320, current 480 x 320, maximum 480 x 320 default connected 480x320+0+0 0mm x 0mm 480x320 0.00* roberto@orangepizero3:~$ DISPLAY=:0.0 xrandr --output default --rotate left xrandr: output default cannot use rotation "left" reflection "none" So, I can't rotate the LCD display with xrandr, and the only option is the 2 actions I shared on March 4 Note: the 4 rotate options are normal, right, left and inverted. None of them worked 0 Quote
le51 Posted Monday at 11:56 AM Posted Monday at 11:56 AM (edited) So I've looked into my drawers and, unfortunately, I can't get my hands on the ili9488 display I own. I will order a new one. But I've got another display of the same type (with the red PCB and 14 pins and resistive touch) with ili9486 driver IC. In LCDWIKI_SPI.cpp, there's an init sequence for that chip, but I'm really confused. On 12/13/2024 at 6:11 AM, robertoj said: THANKS TO USER KungFuPancake, who showed me his github repo, where he indicates to use the latest Armbian-edge, and provides the a command byte sequence for the ili9488 Means that you have use this file: https://github.com/KungfuPancake/v0_ips_touch_display/blob/main/panel-mipi-dbi-spi.txt ? It's really different from what is in LCDWIKI_SPI.cpp around line 1697 (for ili9488) Edited Monday at 11:58 AM by le51 0 Quote
robertoj Posted Monday at 08:46 PM Author Posted Monday at 08:46 PM Yes, you must use that panel-mipi-dbi-spi.txt, process it with the python script, copy it to the right folder, and use the DTS I shared last. I havent seen another command byte sequence for ili9488. Can you post the link to the download (to make sure I will see the same thing). Can you make a hypothetical byte sequence from the LCDWIKI_SPI.cpp? 0 Quote
le51 Posted Tuesday at 10:22 AM Posted Tuesday at 10:22 AM (edited) This is from panel-mipi-dbi-spi.txt command 0xE0 0x00 0x03 0x09 0x08 0x16 0x0A 0x3F 0x78 0x4C 0x09 0x0A 0x08 0x16 0x1A 0x0F command 0xE1 0x00 0x16 0x19 0x03 0x0F 0x05 0x32 0x45 0x46 0x04 0x0E 0x0D 0x35 0x37 0x0F This is from LCDWIKI_SPI.cpp for ili9488: 0xE0, 15, 0x00, 0x07, 0x10, 0x09, 0x17, 0x0B, 0x41, 0x89, 0x4B, 0x0A, 0x0C, 0x0E, 0x18, 0x1B, 0x0F, 0xE1, 15, 0x00, 0x17, 0x1A, 0x04, 0x0E, 0x06, 0x2F, 0x45, 0x43, 0x02, 0x0A, 0x09, 0x32, 0x36, 0x0F, They are other commands that differs slightly. I've found other sources for the init sequence which seems all to be close to panel-mipi-dbi-spi.txt : * Juj fbcp lib: https://github.com/juj/fbcp-ili9341/blob/master/ili9488.cpp#L28 * Bodmer eTFT_SPI lib for microcontrollers : https://github.com/Bodmer/TFT_eSPI/blob/master/TFT_Drivers/ILI9488_Init.h#L11 * Jarret Bucket Adafruit GLX lib : https://github.com/jaretburkett/ILI9488/blob/master/ILI9488.cpp#L378 * this one is for STM32 : https://github.com/RobertoBenjami/stm32_graphics_display_drivers/blob/master/Drivers/lcd/ili9488/ili9488.c#L219 In the same manner, we can found init sequences for other chips in these libraries, eg ili9486. There's already a driver in the kernel source : https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/gpu/drm/tiny/ili9486.c?h=linux-6.12.y but it is specific to Waveshare 35a or PiScreen displays (these with 4 kind of shift register ICs onboard). So for now, while waiting for a new ili9488 display arrives home, I'm digging further around the right init sequence for ili9486. Edited Tuesday at 10:23 AM by le51 1 Quote
le51 Posted Tuesday at 10:41 AM Posted Tuesday at 10:41 AM For reference and as a bookmark reminder * https://github.com/bkosciow/gfxlcd/blob/master/gfxlcd/driver/ili9486/ili9486.py * https://github.com/ZinggJM/ILI9486_SPI/blob/master/src/ILI9486_SPI.cpp * https://github.com/RobertoBenjami/stm32_graphics_display_drivers/blob/master/Drivers/lcd/ili9486/ili9486.c * https://github.com/Bodmer/TFT_eSPI/blob/master/TFT_Drivers/ILI9486_Init.h * https://github.com/ZinggJM/ILI9486_SPI/blob/master/src/ILI9486_SPI.cpp * https://github.com/DeadReDeamed/Raspberry-Pi-LCD-ILI9486-Driver/blob/main/LCD_Driver/LCD_Driver.c 1 Quote
robertoj Posted 11 hours ago Author Posted 11 hours ago Those LCD parameters where you found differences are: PGAMCTRL (Positive Gamma Control) (E0h) NGAMCTRL (Negative Gamma Control) (E1h) (See the ILI9488 PDF I posted) I don't know what they do exactly, but I guess they control pixel voltage, given a R, G or B digital value. I think that you can worry about it, after everything else works. 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.