Jump to content

OrangePi Zero LTS ili9341 TFT LCD (and later OrangePi Zero 3)


robertoj
Go to solution Solved by robertoj,

Recommended Posts

I am experimenting with a cheap ILI9341 screen and mi OrangePi Zero LTS

https://www.aliexpress.us/item/2251832431328471.html

 

I found these recent instructions to be able to display graphics here:

https://ryjelsum.me/homelab/xpt2046-ili9341-opi-zero/

with a reference to a previous experience (without mentioning success)

https://hackaday.io/project/190371-g-edm/log/217902-first-success-with-armbian-nanopi-and-ili9341-touch

and independently, I found these instructions and experiences here:

https://docs.armbian.com/User-Guide_Allwinner_overlays/

https://forum.armbian.com/topic/27457-connecting-banana-pi-m2-zero-with-ili9341-display-over-spi-on-latest-armbian-image/ <-just found it and it has some success with BananaPi M2 Zero

https://tech-de.netlify.app/articles/de547180/index.html

https://4pda.to/forum/index.php?showtopic=782242&st=5060#entry112401076

 

I connected with wires as shown in instructions: https://forum.armbian.com/topic/28674-text-version-of-orange-pi-zero-pinout/

And the LCD's LED input pin to 3.3V

 

I activated the spi-add-cs1 overlay in arbian-config

 

I copied the dts for opiZ into ~/ili9341/ili9341-touch-double-spi-cs.dts

Then, I executed:
 

cd ili9341
armbian-add-overlay ili9341-touch-double-spi-cs.dts

 

Then, I rebooted, and my LCD just looks gray.

 

My armbianEnv looks like this:

verbosity=1
bootlogo=false
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
overlays=spi-add-cs1 tve usbhost2 usbhost3
rootdev=UUID=7d9a7016-73db-4f9c-a5bd-e3e5ab53ffc4
rootfstype=ext4
user_overlays=ili9341-touch-double-spi-cs
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

 

my armbianmonitor -u: https://paste.armbian.com/arogurekiv

 

I am still not done checking against the experiences with Bpi M2-0, but I ask here: anyone has experience with ILI9341+XPT2046, in either OrangePi Zero or Zero 3?

 

Should I downgrade to Linux 6.1.53?

Link to comment
Share on other sites

Armbian & Khadas are rewarding contributors

Just to keep track of my progress:

 

OrangePi Zero can drive a ILI9341, with this ili9341-spi1.dts, with the fb_ili9341.ko driver (not the drm driver). Works on Linux 6.1.104 and Linux 6.6.44

 

Pin connections inside the DTS code:

 

Spoiler
/*
OrangePi Zero -> ILI9341 LCD connections
SPI CLOCK = PA14
SPI DO (LCD MISO) = PA16 (OPIZ MISO)
SPI DI (LCD MOSI) = PA15 (OPIZ MOSI)
LCD DATA/CONTROL = PA18
LCD RESET = PA2
CHIP SELECT = PA13
VCC = 3.3V PIN
GND = GND PIN
*/

/dts-v1/;
/plugin/;
/{
    compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";
	fragment@0 {
	    target = <&pio>;
	    __overlay__{
	        display_pins: display_pins {
                    pins = "PA18", "PA2"; /* 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 0 13 0>;  /* PA13 chip select */
            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 = <320>;
                width = <240>;
                reset-gpios = <&pio 0 2 1>; /* PA2 reset pin*/
                dc-gpios = <&pio 0 18 0>; /* PA18 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";
    };
};

 

and this armbianEnv.txt

Spoiler
verbosity=1
bootlogo=false
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
overlays=usbhost2 usbhost3
rootdev=UUID=677917ab-5341-4634-b556-aafaeaa83c52
rootfstype=ext4
user_overlays=ili9341-spi1
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

 

 

Link to comment
Share on other sites

Investigating why fb_ili9341 works but ili9341 does not.

 

With this ili9341-spi1.dts, fb_ili9341 gets loaded and TFT shows images perfectly

 

Spoiler
/*
OrangePi Zero -> ILI9341 LCD connections
SPI CLOCK = PA14
SPI DO (LCD MISO) = PA16 (OPIZ MISO)
SPI DI (LCD MOSI) = PA15 (OPIZ MOSI)
LCD DATA/CONTROL = PA18
LCD RESET = PA2
CHIP SELECT = PA13
VCC = 3.3V PIN
GND = GND PIN
*/

/dts-v1/;
/plugin/;
/{
    compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";
	fragment@0 {
	    target = <&pio>;
	    __overlay__{
	        display_pins: display_pins {
                    pins = "PA18", "PA2"; /* 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 0 13 0>;  /* PA13 chip select */
            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 = <320>;
                width = <240>;
                reset-gpios = <&pio 0 2 1>; /* PA2 reset pin*/
                dc-gpios = <&pio 0 18 0>; /* PA18 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";
    };
};

 

 

here's the armbian-monitor -u result https://paste.armbian.com/vimetexiqe

Other results in this successful DTS:

Spoiler
roberto@orangepizero:~$ lsmod |grep ili
fb_ili9341             12288  1
fbtft                  36864  1 fb_ili9341
roberto@orangepizero:~$ sudo cat /proc/device-tree/soc/spi@1c69000/status
okay
roberto@orangepizerosudo cat /sys/kernel/debug/pinctrl/1c20800.pinctrl/pinmux-pinspins
Pinmux settings per pin
Format: pin (name): mux_owner gpio_owner hog?
pin 0 (PA0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 1 (PA1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 2 (PA2): (MUX UNCLAIMED) 1c20800.pinctrl:2
pin 3 (PA3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 4 (PA4): 1c28000.serial (GPIO UNCLAIMED) function uart0 group PA4
pin 5 (PA5): 1c28000.serial (GPIO UNCLAIMED) function uart0 group PA5
pin 6 (PA6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 7 (PA7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 8 (PA8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 9 (PA9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 10 (PA10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 11 (PA11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 12 (PA12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 13 (PA13): 1c69000.spi 1c20800.pinctrl:13 function spi1 group PA13
pin 14 (PA14): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA14
pin 15 (PA15): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA15
pin 16 (PA16): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA16
pin 17 (PA17): (MUX UNCLAIMED) 1c20800.pinctrl:17
pin 18 (PA18): (MUX UNCLAIMED) 1c20800.pinctrl:18
pin 19 (PA19): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 20 (PA20): (MUX UNCLAIMED) 1c20800.pinctrl:20
pin 21 (PA21): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 64 (PC0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 65 (PC1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 66 (PC2): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 67 (PC3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 68 (PC4): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 69 (PC5): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 70 (PC6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 71 (PC7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 72 (PC8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 73 (PC9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 74 (PC10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 75 (PC11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 76 (PC12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 77 (PC13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 78 (PC14): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 79 (PC15): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 80 (PC16): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 96 (PD0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 97 (PD1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 98 (PD2): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 99 (PD3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 100 (PD4): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 101 (PD5): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 102 (PD6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 103 (PD7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 104 (PD8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 105 (PD9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 106 (PD10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 107 (PD11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 108 (PD12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 109 (PD13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 110 (PD14): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 111 (PD15): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 112 (PD16): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 113 (PD17): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 128 (PE0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 129 (PE1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 130 (PE2): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 131 (PE3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 132 (PE4): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 133 (PE5): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 134 (PE6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 135 (PE7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 136 (PE8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 137 (PE9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 138 (PE10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 139 (PE11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 140 (PE12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 141 (PE13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 142 (PE14): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 143 (PE15): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 160 (PF0): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF0
pin 161 (PF1): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF1
pin 162 (PF2): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF2
pin 163 (PF3): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF3
pin 164 (PF4): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF4
pin 165 (PF5): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF5
pin 166 (PF6): (MUX UNCLAIMED) 1c20800.pinctrl:166
pin 192 (PG0): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG0
pin 193 (PG1): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG1
pin 194 (PG2): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG2
pin 195 (PG3): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG3
pin 196 (PG4): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG4
pin 197 (PG5): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG5
pin 198 (PG6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 199 (PG7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 200 (PG8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 201 (PG9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 202 (PG10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 203 (PG11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 204 (PG12): (MUX UNCLAIMED) 1c20800.pinctrl:204
pin 205 (PG13): (MUX UNCLAIMED) (GPIO UNCLAIMED)

 

 

When I change the DTS to (notice the differences in compatible and rotate/rotation lines)

Spoiler
/*
OrangePi Zero -> ILI9341 LCD connections
SPI CLOCK = PA14
SPI DO (LCD MISO) = PA16 (OPIZ MISO)
SPI DI (LCD MOSI) = PA15 (OPIZ MOSI)
LCD DATA/CONTROL = PA18
LCD RESET = PA2
CHIP SELECT = PA13
VCC = 3.3V PIN
GND = GND PIN
*/

/dts-v1/;
/plugin/;
/{
    compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";
	fragment@0 {
	    target = <&pio>;
	    __overlay__{
	        display_pins: display_pins {
                    pins = "PA18", "PA2"; /* 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 0 13 0>;  /* PA13 chip select */
            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>;
                rotation = <270>; /* rotate for ili9341, rotation for yx240qv29 */
                bgr=<0>;
                fps = <15>;
                buswidth = <8>;
                height = <320>;
                width = <240>;
                reset-gpios = <&pio 0 2 1>; /* PA2 reset pin*/
                dc-gpios = <&pio 0 18 0>; /* PA18 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";
    };
};

 

 

The TFT remains 100% white. Here's the armbianmonitor -u: https://paste.armbian.com/segulokeso

Other tests in this failed attempt:

Spoiler
roberto@orangepizero:~$ sudo cat /proc/device-tree/soc/spi@1c69000/status
okay
roberto@orangepizero:~$ lsmod|grep ili
ili9341                12288  0
panel_ilitek_ili9341    16384  0
drm_mipi_dbi           20480  2 ili9341,panel_ilitek_ili9341
oberto@orangepizero:~$ sudo cat /sys/kernel/debug/pinctrl/1c20800.pinctrl/pinmux-pins
Pinmux settings per pin
Format: pin (name): mux_owner gpio_owner hog?
pin 0 (PA0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 1 (PA1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 2 (PA2): (MUX UNCLAIMED) 1c20800.pinctrl:2
pin 3 (PA3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 4 (PA4): 1c28000.serial (GPIO UNCLAIMED) function uart0 group PA4
pin 5 (PA5): 1c28000.serial (GPIO UNCLAIMED) function uart0 group PA5
pin 6 (PA6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 7 (PA7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 8 (PA8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 9 (PA9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 10 (PA10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 11 (PA11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 12 (PA12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 13 (PA13): 1c69000.spi 1c20800.pinctrl:13 function spi1 group PA13
pin 14 (PA14): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA14
pin 15 (PA15): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA15
pin 16 (PA16): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA16
pin 17 (PA17): (MUX UNCLAIMED) 1c20800.pinctrl:17
pin 18 (PA18): (MUX UNCLAIMED) 1c20800.pinctrl:18
pin 19 (PA19): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 20 (PA20): (MUX UNCLAIMED) 1c20800.pinctrl:20
pin 21 (PA21): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 64 (PC0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 65 (PC1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 66 (PC2): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 67 (PC3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 68 (PC4): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 69 (PC5): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 70 (PC6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 71 (PC7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 72 (PC8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 73 (PC9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 74 (PC10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 75 (PC11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 76 (PC12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 77 (PC13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 78 (PC14): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 79 (PC15): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 80 (PC16): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 96 (PD0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 97 (PD1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 98 (PD2): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 99 (PD3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 100 (PD4): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 101 (PD5): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 102 (PD6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 103 (PD7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 104 (PD8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 105 (PD9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 106 (PD10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 107 (PD11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 108 (PD12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 109 (PD13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 110 (PD14): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 111 (PD15): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 112 (PD16): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 113 (PD17): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 128 (PE0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 129 (PE1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 130 (PE2): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 131 (PE3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 132 (PE4): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 133 (PE5): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 134 (PE6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 135 (PE7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 136 (PE8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 137 (PE9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 138 (PE10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 139 (PE11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 140 (PE12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 141 (PE13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 142 (PE14): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 143 (PE15): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 160 (PF0): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF0
pin 161 (PF1): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF1
pin 162 (PF2): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF2
pin 163 (PF3): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF3
pin 164 (PF4): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF4
pin 165 (PF5): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF5
pin 166 (PF6): (MUX UNCLAIMED) 1c20800.pinctrl:166
pin 192 (PG0): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG0
pin 193 (PG1): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG1
pin 194 (PG2): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG2
pin 195 (PG3): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG3
pin 196 (PG4): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG4
pin 197 (PG5): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG5
pin 198 (PG6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 199 (PG7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 200 (PG8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 201 (PG9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 202 (PG10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 203 (PG11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 204 (PG12): (MUX UNCLAIMED) 1c20800.pinctrl:204
pin 205 (PG13): (MUX UNCLAIMED) (GPIO UNCLAIMED)

 

 

In both cases, I used sudo armbian-add-overlay ili9341-spi1.dts, and my armbianEnv remained the same:

Spoiler
verbosity=1
bootlogo=false
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
overlays=usbhost2 usbhost3
rootdev=UUID=54388674-edbe-4032-83b8-1f048fe55a29
rootfstype=ext4
user_overlays=ili9341-spi1
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

 

 

Link to comment
Share on other sites

I tried this DTS, to try to declare, reserve, or pin mux the chip select (I don't know what the added block does)

 

Spoiler
/*
OrangePi Zero -> ILI9341 LCD connections
SPI CLOCK = PA14
SPI DO (LCD MISO) = PA16 (OPIZ MISO)
SPI DI (LCD MOSI) = PA15 (OPIZ MOSI)
LCD DATA/CONTROL = PA18
LCD RESET = PA2
CHIP SELECT = PA13
VCC = 3.3V PIN
GND = GND PIN
*/

/dts-v1/;
/plugin/;
/{
    compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";
	fragment@0 {
	    target = <&pio>;
	    __overlay__{
                spi1_cs0: spi1_cs0 {
                    pins = "PA13"; 
                    function = "gpio_out";
                    output-high;
                };
	        display_pins: display_pins {
                    pins = "PA18", "PA2"; /* 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";
            cs-gpios = <&pio 0 13 0>;  /* PA13 chip select */
            num-chipselects = <1>;
            display: display@0 {
                pinctrl-1 = <&spi1_cs0>; /* Mux the PI to make sure they are set in spi Mode */
                reg = <0>;
                compatible = "adafruit,yx240qv29","ilitek,ili9341";
                /*compatible = "ilitek,ili9341";*/
                spi-max-frequency = <40000000>;
                status="okay";
                pinctrl-names = "default";
                pinctrl-0 = <&display_pins>;
                rotation = <270>; /* rotate for ili9341, rotation for yx240qv29 */
                bgr=<0>;
                fps = <15>;
                buswidth = <8>;
                height = <320>;
                width = <240>;
                dc-gpios = <&pio 0 18 0>; /* PA18 Data control pin */
                reset-gpios = <&pio 0 2 1>; /* PA2 reset pin*/
                debug = <4>;
                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";
    };
};

 

 

The TFT screen did not work (100% white), but at least I see more pins used in pinctrl (PA2, PA18)

Spoiler
roberto@orangepizerosudo cat /sys/kernel/debug/pinctrl/1c20800.pinctrl/pinmux-pinspins
Pinmux settings per pin
Format: pin (name): mux_owner gpio_owner hog?
pin 0 (PA0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 1 (PA1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 2 (PA2): spi0.0 1c20800.pinctrl:2 function gpio_out group PA2
pin 3 (PA3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 4 (PA4): 1c28000.serial (GPIO UNCLAIMED) function uart0 group PA4
pin 5 (PA5): 1c28000.serial (GPIO UNCLAIMED) function uart0 group PA5
pin 6 (PA6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 7 (PA7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 8 (PA8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 9 (PA9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 10 (PA10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 11 (PA11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 12 (PA12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 13 (PA13): 1c69000.spi 1c20800.pinctrl:13 function spi1 group PA13
pin 14 (PA14): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA14
pin 15 (PA15): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA15
pin 16 (PA16): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA16
pin 17 (PA17): (MUX UNCLAIMED) 1c20800.pinctrl:17
pin 18 (PA18): spi0.0 1c20800.pinctrl:18 function gpio_out group PA18
pin 19 (PA19): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 20 (PA20): (MUX UNCLAIMED) 1c20800.pinctrl:20
pin 21 (PA21): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 64 (PC0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 65 (PC1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 66 (PC2): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 67 (PC3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 68 (PC4): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 69 (PC5): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 70 (PC6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 71 (PC7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 72 (PC8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 73 (PC9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 74 (PC10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 75 (PC11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 76 (PC12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 77 (PC13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 78 (PC14): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 79 (PC15): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 80 (PC16): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 96 (PD0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 97 (PD1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 98 (PD2): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 99 (PD3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 100 (PD4): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 101 (PD5): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 102 (PD6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 103 (PD7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 104 (PD8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 105 (PD9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 106 (PD10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 107 (PD11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 108 (PD12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 109 (PD13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 110 (PD14): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 111 (PD15): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 112 (PD16): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 113 (PD17): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 128 (PE0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 129 (PE1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 130 (PE2): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 131 (PE3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 132 (PE4): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 133 (PE5): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 134 (PE6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 135 (PE7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 136 (PE8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 137 (PE9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 138 (PE10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 139 (PE11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 140 (PE12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 141 (PE13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 142 (PE14): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 143 (PE15): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 160 (PF0): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF0
pin 161 (PF1): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF1
pin 162 (PF2): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF2
pin 163 (PF3): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF3
pin 164 (PF4): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF4
pin 165 (PF5): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF5
pin 166 (PF6): (MUX UNCLAIMED) 1c20800.pinctrl:166
pin 192 (PG0): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG0
pin 193 (PG1): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG1
pin 194 (PG2): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG2
pin 195 (PG3): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG3
pin 196 (PG4): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG4
pin 197 (PG5): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG5
pin 198 (PG6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 199 (PG7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 200 (PG8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 201 (PG9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 202 (PG10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 203 (PG11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 204 (PG12): (MUX UNCLAIMED) 1c20800.pinctrl:204
pin 205 (PG13): (MUX UNCLAIMED) (GPIO UNCLAIMED)

 

 

Link to comment
Share on other sites

So, I temporarily quit the effort to make ili9341.ko work, and continue with fb_ili9341.ko

 

(Note: try changing the reset HIGH/LOW polarity, as advised in https://forums.raspberrypi.com/viewtopic.php?t=358240&start=25 )

 

To make this work with the orangepi zero 3, the DTS needed would be changed in the pinout, and the compatible line:

 

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 = "**************"; /*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 = <320>;
                width = <240>;
                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";
    };
};

 

 

Now I need to try this at home

Link to comment
Share on other sites

  • Solution

For anyone interested in connecting the ili9341 to an orange pi zero, and use the adafruit DRM driver: ili9341-spi1-drm.dts

 

Spoiler
/*
OrangePi Zero -> ILI9341 LCD connections
SPI CLOCK = PA14
SPI DO (LCD MISO) = PA16 (OPIZ MISO)
SPI DI (LCD MOSI) = PA15 (OPIZ MOSI)
LCD DATA/CONTROL = PA18
LCD RESET = PA2
CHIP SELECT = PA13
VCC = 3.3V PIN
GND = GND PIN
*/

/dts-v1/;
/plugin/;
/{
    compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";
	fragment@0 {
	    target = <&pio>;
	    __overlay__{
	        display_pins: display_pins {
                    pins = "PA18", "PA2"; /* 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 0 13 0>;  /* PA13 chip select */
            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>;
                rotation = <270>; /* rotate for ili9341, rotation for yx240qv29 */
                bgr=<0>;
                fps = <15>;
                buswidth = <8>;
                height = <320>;
                width = <240>;
                reset-gpios = <&pio 0 2 0>; /* PA2 reset pin*/
                dc-gpios = <&pio 0 18 0>; /* PA18 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 made these experiments, since the LCD is the only one chip in the SPI bus.

* disconnect the LCD's Chip Select -> LCD remains white

* connect the LCD's Chip Select to GND -> LCD displays the login line and linux crashes soon after <- it might be my orange pi zero, which needs a heatsink

 

Link to comment
Share on other sites

It turned out that my USB power cable was too long... I replaced it with the previous short one and I am back in business.

 

I am experimenting with NOT USING CS. Good progress:

 

In the DTS, comment out with "/*" the line cs-gpios = <&pio 0 13 0>; /* PA13 chip select */

Also, change this line num-chipselects = <1>; to <0>

 

Previous result of: sudo cat /sys/kernel/debug/pinctrl/1c20800.pinctrl/pinmux-pins

...

Spoiler

pin 13 (PA13): 1c69000.spi 1c20800.pinctrl:13 function spi1 group PA13
pin 14 (PA14): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA14
pin 15 (PA15): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA15
pin 16 (PA16): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA16

 

New result, with NO CS configuration:

...

Spoiler

pin 13 (PA13): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA13
pin 14 (PA14): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA14
pin 15 (PA15): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA15
pin 16 (PA16): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA16

...

^ with my next steps, I hope to verify that PA13 is available for other things

 

It plays an h264 file with no hiccups ;)

mplayer -vo fbdev2:/dev/fb0 mj_remember_time.mp4

Link to comment
Share on other sites

When the chip select is not specified, as above, the gpio pin is available for other uses :)

 

I read somewhere that the ili9341 does not need the MISO wire because no information is read from the LCD ever... is this true?

Some people are getting away with it

https://forums.raspberrypi.com/viewtopic.php?t=370089

 

Also, if a wire is loose momentarily, the LCD locks up or turns "white-washed"... is there a way to reset the LCD and its KO module?

Link to comment
Share on other sites

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