Jump to content

NanoPi NEO SPI Display PCD8544


viteo

Recommended Posts

I'm missing something essential.
I have NanoPi Neo v1.4 with Armbian 23.5 Jammy CLI (Linux nanopineo 6.1.30-sunxi). My display is Nokia5110 LCD or PCD8544

With spi-spidev DT I can successfully via `spidev0.0` with `spi-tools`. I.e. I confirm that spi is working.
Now, I studied about DTO and fbtft driver, found that it supports pcd8544.


I wrote this kind of DTO and added it to `armbianEnv.txt`

/*
* Device: LCD5110 (nokia5110) 1.6"(84x48px) SPI display Module PCD8544
* Module      Connector
* SDI(MOSI)	<-  PC0
* SCK		<-  PC2
* CS		<-  PC3
* RESET		<-  PA1
* DC/RS		<-  PA3
* LED		<-  PA2
*/

/dts-v1/;
/plugin/;

/ {
    compatible = "allwinner,sun8i-h3";
    
    fragment@0 {
        target = <&pio>;
        __overlay__ {
            display_pins: display_pins {
                pins = "PA1", "PA3"; /*RESET, DC_RS*/
                function = "gpio_out";
            };
        };
    };
    
    fragment@1 {
        target = <&spi0>;
        __overlay__ {
            /* needed to avoid dtc warning */
            #address-cells = <1>;
			#size-cells = <0>;
            status = "okay";
            cs-gpios = <&pio 2 3 0>; /* ChipSelect PC3 */
            pcd8544: pcd8544@0 {
                compatible = "philips,pcd8544";
                reg = <0>;
                pinctrl-names = "default";
                pinctrl-0 = <&display_pins>;
                spi-max-frequency = <4000000>;
                buswidth = <8>;
                fps = <5>;
                // led-gpios = <&pio 0 2 1>; /*LED=PA2*/
                reset-gpios = <&pio 0 1 1>; /*RESET=PA1*/
                dc-gpios = <&pio 0 3 0>; /*DC_RS=PA3*/
            };
        };
    };
};

I'm seeing in serial output `Applying user provided DT overlay sun8i-h3-spi-pdc8544.dtbo`

But... 

Thats all.
`dmesg | grep spi` or `dmesg | grep fbtft` is empty.

`lsmod | grep fb` - also nothing.

`ls /dev/fb*` - nope.

If I manually call for `sudo modprobe spi:fb_pcd8544`
this prints into dmesg:
 

Quote

fbtft: module is from the staging directory, the quality is unknown, you have been warned.
fb_pcd8544: module is from the staging directory, the quality is unknown, you have been warned.
SPI driver fb_pcd8544 has no spi_device_id for philips,pcd8544

 

I've tried a lot of different tweaks in DTO, I've tried different releases from download page for my board.
I don't know what am I missing.
Is it somehow related to CLI nature of images?
Why does no fb device apeears?

Any help would be appreciated. Thank you.

Edited by viteo
Link to comment
Share on other sites

Hi there,

 

does 'lsmod | grep pdc8544' even show that they module has even load? unfortunately the fbtft drivers are not that well supported hence being in the staging directory. I would advice that you look for a tiny drm based driver which is the way that small displays tend to be handled with the more recent kernel versions

 

best of luck

Link to comment
Share on other sites

oh. i've looked at your reply and something catched my eye.

it's not `pdc8544` it's `pcd8544`

I was copypasting this alias string from internet for three days..
checked modinfo and there:
 

Quote

alias:          spi:pcd8544
alias:          spi:fb_pcd8544
alias:          philips,pcd8544

 

i'm sorry. i'm so dumb.

Replaced with right string:

                compatible = "philips,pcd8544";

It's working now!

p.s. i've edited original post for the case someone copy DT code.


p.p.s. I'll take a loot at tinydrm, but googleing doen't give much for v6 kernel. if it's not a generic driver, there might not be pcd8544 tinydrm driver.

Edited by viteo
Link to comment
Share on other sites

Guys, I'm lookig for your help again.

Trying to start this display with TinyDRM.
The module I looking for is `panel-mipi-dbi`. I've built Armbian with this module enabled.
Edited my dts as follows:
 

/dts-v1/;
/plugin/;

/ {
    compatible = "allwinner,sun8i-h3";
    
    fragment@0 {
        target = <&pio>;
        __overlay__ {
            display_pins: display_pins {
                pins = "PA1", "PA3", "PA2"; /*RESET, DC_RS*/
                function = "gpio_out", "gpio_out", "gpio_out";
            };
        };
    };
    
    fragment@1 {
        target = <&spi0>;
        __overlay__ {
            /* needed to avoid dtc warning */
            #address-cells = <1>;
            #size-cells = <0>;

            status = "okay";
            cs-gpios = <&pio 2 3 0>; /* ChipSelect PC3 */
            num-chipselects = <1>;

            panel: panel@0 {
                compatible = "pcd8544", "panel-mipi-dbi-spi";
                reg = <0>;
                spi-max-frequency = <4000000>;

                dc-gpios = <&pio 0 3 0>; /*DC_RS=PA3*/
                reset-gpios = <&pio 0 1 1>; /*RESET=PA1*/
                /*led-gpios = <&pio 0 2 0>; /*LED=PA2*/
                write-only;

                width-mm = <35>;
                height-mm = <27>;

                panel-timing {
                    hactive = <84>;
                    vactive = <48>;
                    hback-porch = <0>;
                    vback-porch = <0>;
                    clock-frequency = <0>;
                    hfront-porch = <0>;
                    hsync-len = <0>;
                    vfront-porch = <0>;
                    vsync-len = <0>;
                };
            };
        };
    };
};

Tried both variants with `<&pio>` target and without. Double checked aliases :)

Also added firmware `pcd8544.bin` to /lib/firmware

command 0x21 # Function set
command 0x04 # Temperature control (0)
command 0x17 # Bias system (4)
command 0x22 # Function set
command 0x0C # Display control

 

But no luck again. Module is not loaded, dmesg tells nothing =/
Also found this  topic, but my display is still blank.

Edited by viteo
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