Jump to content

Orange Pi Zero 3 ili9486 TFT LCD


Go to solution Solved by WDR_s,

Recommended Posts

Posted
36 minutes ago, Sári Zoltán said:

Orange Pi Lite:

Different soc and even different soc family. This most likely will not work on h618.

Posted
20 hours ago, Sári Zoltán said:

Paste your custom overlay configuration for SPI, DC, and reset GPIOs

 

 

 

Share your DTS. It is the most challenging part of this. We can customize, based on SBC model.

Posted (edited)

In my first post, I shared it in a file called "spi-display-overlay.txt".
Yes, I know it’s strange that it’s in a .txt file — but it’s there nonetheless. 
But you know what? Here it is :) :
 

/dts-v1/;
/plugin/;

/ {
    compatible = "allwinner,sun50i-h616";  /* Orange Pi Lite SoC */

    fragment@0 {
        target = <&spi0>;  /* SPI0 bus */
        __overlay__ {
            status = "okay";
        };
    };

    fragment@1 {
        target = <&spi0>;
        __overlay__ {
            #address-cells = <1>;
            #size-cells = <0>;

            ili9486: ili9486@0 {
                compatible = "ilitek,ili9486";
                reg = <0>;  /* CS0 */

                spi-max-frequency = <24000000>;  /* Speed of SPI */
                rotate = <0>;
                fps = <30>;
                buswidth = <8>;
                regwidth = <16>;
                bgr = <0>;

                reset-gpios = <&pio 2 8 1>; /* PC08 */
                dc-gpios = <&pio 2 7 0>;     /* PC07 */

                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
                        0x1000036 0x28
                        0x1000011
                        0x1000029>;
            };
        };
    };
};

Edited by Sári Zoltán
Posted

Thank you for sharing it :)

 

Can you include these specifications, for quick reference for future readers?

Board, Debian version, Kernel, Graphics (console, X11, wayland)

Posted

Hi @robertoj and @WDR_s
I am having a similar screen ILI9486 from waveshare that i am trying to make it work with Milk-v duo S board.
https://www.waveshare.com/wiki/3.5inch_RPi_LCD_(B)

 

I was able to drive ST7789v and see content on screen with below code dts file
 

&spi3 {
        status = "okay";

        /delete-node/ spidev@0;

        st7789v: st7789v@0 {
                compatible = "sitronix,st7789v";
                reg = <0>;
                spi-max-frequency = <48000000>;
                spi-cpol;
                spi-cpha;
                rotate = <0>;
                fps = <60>;
                rgb;
                buswidth = <8>;

                dc = <&porta 18 GPIO_ACTIVE_HIGH>;
                reset = <&porta 28 GPIO_ACTIVE_HIGH>;

                debug = <0x0>;
                status = "okay";
        };
};


But trying to make ILi9486 work is next to impossible for me.
I tried the dts file modification that worked for @WDR_s before he implemented touch. But this also does not work for me. And just for information dc-gpios and reset-gpios does not work for me and i have to name it dc and reset or else device  /dev/fb0 is not created.

&spi3 {
    status = "okay";
    #address-cells = <1>;
    #size-cells = <0>;

    /delete-node/ spidev@0;

    ili9486: ili9486@0 {
        /* IMPORTANT: fb_tft binds MUCH more reliably to this */
        compatible = "ilitek,ili9341";

        reg = <0>;
        status = "okay";

        /* SPI MODE 0 (correct for Waveshare ILI9486) */
        spi-max-frequency = <24000000>;

        /* Use SAME pins that worked for ST7789V */
        dc    = <&porta 18 GPIO_ACTIVE_HIGH>;
        reset = <&porta 28 GPIO_ACTIVE_HIGH>;

        rotate   = <0>;
        bgr      = <0>;
        fps      = <30>;
        regwidth = <16>;
        buswidth = <8>;
        txbuflen = <65536>;
        debug    = <3>;

        /* Long, safe init sequence */
        init = <0x10000b0 0x00
                0x1000011
                0x20000ff
                0x10000C0 0x0D 0x0D
                0x10000C1 0x43
                0x10000C5 0x00 0x48 0x80
                0x10000C7 0x00
                0x1000036 0x28
                0x100003A 0x55
                0x10000B1 0xB0 0x11
                0x10000F0 0x01
                0x10000F6 0x00 0x01 0x32
                0x1000026 0x01
                0x10000E0 0x0F 0x31 0x2B 0x0C 0x0E 0x08 0x4E 0xF1 0x37 0x07 0x10 0x03 0x0E 0x09 0x00
                0x10000E1 0x00 0x0E 0x14 0x03 0x11 0x07 0x31 0xC1 0x48 0x08 0x0F 0x0C 0x31 0x36 0x0F
                0x10000B6 0x02 0x02 0x3B
                0x1000011
                0x20000ff
                0x1000029>;
    };
};


This is very critical for me and i would really appreciate if you could make things work for me. Is the kernel 5.10 a issue here? as my SPI pins work for other display but not just for this display.
 

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines