Jump to content

Recommended Posts

Posted (edited)

Hello, I`ll try to hook up display to OpangePi PC, But have no output.

My English is not native so i`ll try to write in simlpe way.

 

image

Armbian_23.8.1_Orangepipc_jammy_current_6.1.47_minimal.img.xz

 

my dts:

/dts-v1/;
/plugin/;
/ {
    compatible = "allwinner,sun8i-h3";
    fragment@0 {
        target = <&spi0>;
        __overlay__ {
            status = "okay";
            // cs-gpios = <&pio 0 9 0>,<&pio 0 8 0>; /* PA9=CS0 for LCD, PA8=CS1 for touch */
            display: display@0 {
                compatible = "ilitek,ili9341";
                reg = <0>;
                pinctrl-names = "default";
                spi-max-frequency = <20000000>;
                txbuflen = <65536>;
                rotate = <270>;
                bgr = <0>;
                fps = <30>;
                buswidth = <8>;
                regwidth = <16>;
                height = <480>;
                width = <320>;
                reset-gpios = <&pio 0 2 1>; /* PA20 */
                dc-gpios = <&pio 0 71 0>; /* PA10 */
                debug = <0>;
                init = <0x10000b0 0x00 // Interface Mode Control
                        0x1000011  // Sleep Out
                        0x20000ff  // Delay (255ms)
                        0x10000C0 0x0D 0x0D  // Power Control 1
                        0x10000C1 0x43  // Power Control 2
                        0x10000C5 0x00 0x48 0x80  // VCOM Control 1
                        0x10000C7 0x00  // VCOM Control 2
                        0x1000036 0x28  // Memory Access Control (Rotacao)
                        0x100003A 0x55  // Pixel Format Set (16bit)
                        0x10000B1 0xB0 0x11  // Frame Rate Control
                        0x10000F0 0x01 // Enable Extended Comand Set
                        0x10000F6 0x00 0x01 0x32 // SPI ilInterface Control
                        0x1000026 0x01 // Gamma Set
                        0x10000E0 0x0F 0x31 0x2B 0x0C 0x0E 0x08 0x4E 0xF1 0x37 0x07 0x10 0x03 0x0E 0x09 0x00  // Positive Gamma Correction
                        0x10000E1 0x00 0x0E 0x14 0x03 0x11 0x07 0x31 0xC1 0x48 0x08 0x0F 0x0C 0x31 0x36 0x0F  // Negative Gamma Correction
                        0x10000B6 0x02 0x02 0x3B  // Display Function Control
                        0x1000011  // Sleep Out
                        0x20000ff  // Delay (255ms)
                        0x1000029>; // Display ON
                };
//                xpt2046: xpt2046@1 {
//                                compatible = "ti,ads7846";
//                                reg = <1>;
//                                spi-max-frequency = <2000000>;
//                                interrupts = <0 7 2>; /* high-to-low edge triggered */
//                                interrupt-parent = <&pio>;
//                                pendown-gpio = <&pio 0 7 0>;
//                                ti,keep-vref-on = <1>;
//                                ti,x-min = /bits/ 16 <200>;
//                                ti,x-max = /bits/ 16 <3900>;
//                                ti,y-min = /bits/ 16 <200>;
//                                ti,y-max = /bits/ 16 <3900>;
//                                ti,x-plate-ohms = /bits/ 16 <60>;
//                                ti,pressure-max = /bits/ 16 <255>;
//                                ti,swap-xy = <1>;
//            };
        };
    };
};

 

when board boots, display switch from white to black. Without console output.

 

gpio readall - looks good. all pins present.

 

when I try Armbian_25.8.1_Orangepione_noble_current_6.12.43.img.xz

board boots. add overlay to it, by armbian-add-overlays

remove HDMI cable. (Really good first-config over ssh, why not to add this to other boards, like mine?)

reboot

Display works(Ony if HDMI is unpluged), with output of boot Armbian.

 

I`ll think this something wrong with output on spi LCD over OrangePi PC Armbian build, or sometning like that way....

Any advise?

 

UPD:

Ok. I get it to work.(Armbian_23.8.1_Orangepipc_jammy_current_6.1.47_minimal.img.xz)

ili9341 may be changed to ili9486. Didn`t matter...why?

dmesg | grep graphics
[    9.406143] graphics fb1: fb_ili9486 frame buffer, 480x320, 300 KiB video memory, 64 KiB buffer memory, fps=31, spi0.0 at 16 MHz

 

con2fbmap 1 1
 

and it works....

 

UPD 2: ili9486.dtbo With touch working, tested trought evtest

Edited by ComProf
Posted (edited)

Try this solution for the orange pi zero LTS, which is the same chip as the opiPC, but change the pin definitions to what you have.

 

Do you have a 480x320 ili9341? Which one is it?

Edited by robertoj
Posted (edited)

MPI3501-001.jpg.c32128558edc59188f55310ac8ccb7fb.jpg

I`ll think its china lcd, it`s been presented many ears ago by someone to me.

Thanks to your sugestions. I read it before topic up.

As U can read, it working now, with touch

 

The last question is how to output to it when system boots...

Something like auto switch from HDMI to SPI LCD.

Or just SPI LCD output after U-Boot loading.

 

rc.local with con2fbmap 1 1 in it is not an good thing.

Any Advice?

Edited by ComProf
Posted (edited)

In that case, dont try my solution: it is for the red ili9341.

 

If you search ili9486 threads in this forum, that same blue LCD is ili9486... so you were wrong in calling it ili9341 in the first place :)

 

If you have time, find another solution to get you a DRM frambuffer (instead of a classic FB). Then you can enjoy smoother animations and video.

 

Regarding displaying boot messages to the LCD, instead of HDMI. I don't know, but it may be because your HDMI is /dev/fb0 and the LCD is /dev/fb1

 

Will you use X11?

Edited by robertoj
Posted (edited)

He works as ili9341 and as ili9486. I use it now as ili9486.

I`ll go further to make it work as native device.

Цитата

If you have time, find another solution to get you a DRM frambuffer (instead of a classic FB). Then you can enjoy smoother animations and video.

DRM frambuffer its something what needs to be kernel recompiled... as i know?

And if i want to use it natively, i must edit or recompile u-boot....

 

DRM support for ILI9486 display panels
modulename: ili9486.ko
configname: CONFIG_TINYDRM_ILI9486
Linux Kernel Configuration
└─>Device Drivers
└─>Graphics support
└─>Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)
└─>SPI support
└─>DRM support for ILI9486 display panels
In linux kernel since version 4.14.326 (release Date: 2023-09-23)  
DRM driver for the following Ilitek ILI9486 panels:
* PISCREEN 3.5" 320x480 TFT (Ozzmaker 3.5")
* RPILCD 3.5" 320x480 TFT (Waveshare 3.5")

If M is selected the module will be called ili9486.

 

Цитата

Will you use X11?

I will use it for KlipperScreen 😆

 

But as i se how hard is working that orangePi PC,i`ll doubt if i need this...

Any way i`ll try ))

 

Цитата

Regarding displaying boot messages to the LCD, instead of HDMI. I don't know, but it may be because your HDMI is /dev/fb0 and the LCD is /dev/fb1

Yes. But HDMI not connected. On OrangePiOne image its switching. If HDMI is connected its use it with no output to SPI. But if no HDMI present its use SPI as basic overlay

On the same board. Because OPiOne had only 1 usb, OPiPC work only 1 usb ))) if whey work all 3, i`ll didnt open up a topic 😑

ili9486.dts

Edited by ComProf

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