您尚未登录。

楼主 #1 2019-08-06 14:41:49

danile
会员
注册时间: 2019-07-08
已发帖子: 76
积分: 54.5

请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

请教ST7789V,不显示,发现波形完全不对!仔细防照
http://zero.lichee.pro/%E8%B4%A1%E7%8C%AE/article%203.html?highlight=fbtft
LicheePizero_SPI_LCD_st7789.pdf

操作,还是没有效果!!!

dts文件: https://whycan.cn/files/members/1808/dts.zip


sun8i-v3s-licheepi-zero-dock.dts 文件:

/*
 * Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.xyz>
 *
 * This file is dual-licensed: you can use it either under the terms
 * of the GPL or the X11 license, at your option. Note that this dual
 * licensing only applies to this file, and not this project as a
 * whole.
 *
 *  a) This file is free software; you can redistribute it and/or
 *     modify it under the terms of the GNU General Public License as
 *     published by the Free Software Foundation; either version 2 of the
 *     License, or (at your option) any later version.
 *
 *     This file is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 * Or, alternatively,
 *
 *  b) Permission is hereby granted, free of charge, to any person
 *     obtaining a copy of this software and associated documentation
 *     files (the "Software"), to deal in the Software without
 *     restriction, including without limitation the rights to use,
 *     copy, modify, merge, publish, distribute, sublicense, and/or
 *     sell copies of the Software, and to permit persons to whom the
 *     Software is furnished to do so, subject to the following
 *     conditions:
 *
 *     The above copyright notice and this permission notice shall be
 *     included in all copies or substantial portions of the Software.
 *
 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *     OTHER DEALINGS IN THE SOFTWARE.
 */

#include "sun8i-v3s-licheepi-zero.dts"

#include <dt-bindings/input/input.h>

/ {
	model = "Lichee Pi Zero with Dock";
	compatible = "licheepi,licheepi-zero-dock", "licheepi,licheepi-zero",
		     "allwinner,sun8i-v3s";

	aliases {
		ethernet0 = &emac;
	};

	leds {
		/* The LEDs use PG0~2 pins, which conflict with MMC1 */
		status = "disbaled";
	};

	chosen {
		/delete-node/ framebuffer@0;
	};
};


&spi0 {
	status = "okay";

	st7789v@0 {
		compatible = "sitronix,st7789v";
		reg = <0>;
		reset-gpios = <&pio 4 20 GPIO_ACTIVE_LOW>;
		dc-gpios = <&pio 4 1 GPIO_ACTIVE_LOW>;
		/*backlight = <&pwm_bl>;*/
		spi-max-frequency = <15000000>;
		spi-cpol;
		spi-cpha;
		bgr;
		buswidth = <8>;
		rotate = <270>;
		fps = <10>;
	};

};


&codec {
	allwinner,audio-routing =
		"Headphone", "HP",
		"Headphone", "HPCOM",
		"MIC1", "Mic",
		"Mic",  "HBIAS";
	status = "okay";
};

&emac {
	status = "okay";
};

&mmc1 {
	broken-cd;
	bus-width = <4>;
	vmmc-supply = <&reg_vcc3v3>;
	status = "okay";
};

&lradc {
	vref-supply = <&reg_vcc3v0>;
	status = "okay";

	button@200 {
		label = "Volume Up";
		linux,code = <KEY_VOLUMEUP>;
		channel = <0>;
		voltage = <200000>;
	};

	button@400 {
		label = "Volume Down";
		linux,code = <KEY_VOLUMEDOWN>;
		channel = <0>;
		voltage = <400000>;
	};

	button@600 {
		label = "Select";
		linux,code = <KEY_SELECT>;
		channel = <0>;
		voltage = <600000>;
	};

	button@800 {
		label = "Start";
		linux,code = <KEY_OK>;
		channel = <0>;
		voltage = <800000>;
	};
};

加载驱动时候的波形如下:

文件:saleae 1.1.18版本以上可以打开   https://whycan.cn/files/members/1808/none.zip

_20190806143100.png


加载驱动时候的波形如下:

文件:saleae 1.1.18版本以上可以打开   https://whycan.cn/files/members/1808/fb.zip

_20190806143918.png

离线

楼主 #3 2019-08-06 15:35:19

danile
会员
注册时间: 2019-07-08
已发帖子: 76
积分: 54.5

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!


下面的那个,好像复位引脚没有变高,也没有复位电平

最近编辑记录 danile (2019-08-06 15:36:04)

离线

楼主 #5 2019-08-06 15:44:07

danile
会员
注册时间: 2019-07-08
已发帖子: 76
积分: 54.5

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

晕哥 说:

spi 的时序能对上吗?


除了设备驱动加载时候,SPI发送的全是0,感觉不正常,加载完,我cat xxx>/dev/fb0  ,SPI前面一段杂乱的波形,后面数据是对的

离线

楼主 #7 2019-08-06 16:16:01

danile
会员
注册时间: 2019-07-08
已发帖子: 76
积分: 54.5

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

晕哥 说:

https://whycan.cn/t_2740.html

spi-max-frequency = <50000000>;
/*spi-cpol;*/
/*spi-cpha;*/

频率降低到 6M, 开启 cpol, cpha:

spi-max-frequency = <6000000>;
spi-cpol;
spi-cpha;

这样试一试.


https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/display/panel/sitronix%2Cst7789v.txt


还是不行呢  https://whycan.cn/files/members/1808/none_20190806-1615.zip

离线

楼主 #8 2019-08-06 16:29:21

danile
会员
注册时间: 2019-07-08
已发帖子: 76
积分: 54.5

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

danile 说:
晕哥 说:

https://whycan.cn/t_2740.html

spi-max-frequency = <50000000>;
/*spi-cpol;*/
/*spi-cpha;*/

频率降低到 6M, 开启 cpol, cpha:

spi-max-frequency = <6000000>;
spi-cpol;
spi-cpha;

这样试一试.


https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/display/panel/sitronix%2Cst7789v.txt


还是不行呢  https://whycan.cn/files/members/1808/none_20190806-1615.zip


好像有点正常了,晚上试试,感谢晕哥

离线

楼主 #10 2019-08-06 16:42:24

danile
会员
注册时间: 2019-07-08
已发帖子: 76
积分: 54.5

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

晕哥 说:

等你好消息 ^_^


https://github.com/Lichee-Pi/linux/blob/zero-4.13.y/drivers/staging/fbtft/fb_st7789v.c

源代码里面没看到 复位的操作呢,为什么 Documentation\devicetree\bindings\display\panel\sitronix,st7789v.txt  文件里面有复位引脚!!

而且我发现ili9341里面有复位的相关操作:
https://github.com/Lichee-Pi/linux/blob/zero-4.13.y/drivers/staging/fbtft/fb_ili9341.c

par->fbtftops.reset(par);

离线

楼主 #12 2019-08-06 17:19:40

danile
会员
注册时间: 2019-07-08
已发帖子: 76
积分: 54.5

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

晕哥 说:

可能是在别的文件实现了:

$ grep reset-gpios -r drivers/staging/
drivers/staging/fbtft/fbtft-core.c:     ret = fbtft_request_one_gpio(par, "reset-gpios", 0, &par->gpio.reset);
drivers/staging/greybus/arche-apb-ctrl.c:       apb->resetn_gpio = of_get_named_gpio(np, "reset-gpios", 0);


这个复位Io应该不是屏幕的复位,而是系统的复位

离线

楼主 #13 2019-08-06 17:42:33

danile
会员
注册时间: 2019-07-08
已发帖子: 76
积分: 54.5

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

晕哥 说:

可能是在别的文件实现了:

$ grep reset-gpios -r drivers/staging/
drivers/staging/fbtft/fbtft-core.c:     ret = fbtft_request_one_gpio(par, "reset-gpios", 0, &par->gpio.reset);
drivers/staging/greybus/arche-apb-ctrl.c:       apb->resetn_gpio = of_get_named_gpio(np, "reset-gpios", 0);


可以了,我加了那句就可以了,感谢

离线

楼主 #15 2019-08-06 20:57:38

danile
会员
注册时间: 2019-07-08
已发帖子: 76
积分: 54.5

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

晕哥 说:

现在可以显示了吗?

可以的,其实就是那个复位问题,至于波形很乱,是因为spi时钟超过了逻辑分析仪的上限了

离线

楼主 #17 2019-08-06 22:07:48

danile
会员
注册时间: 2019-07-08
已发帖子: 76
积分: 54.5

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

把复位代码加载初始化之前:

_20190806220508.png



_20190806220655.jpg

离线

楼主 #20 2019-08-07 08:22:03

danile
会员
注册时间: 2019-07-08
已发帖子: 76
积分: 54.5

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

晕哥 说:

屏幕看起来效果挺好,在哪里买的?



是以前给客户开发产品,给的几片,厂家好像叫做华宇彩晶

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn