IMX8MM-LCD-ILI9806E调试流程

/Documentation/devicetree/bindings/leds/backlight

/Documentation/devicetree/bindings/pwm

image.png

image.png

lcd_reset ----->SAI5_RXFS
DSI_BL_PWM ----->GPIO1_IO15

TPS61160

When the CTRL pin is constantly high, the FB voltage is regulated to 200mV typically. However, the CTRL pin
allows a PWM signal to reduce this regulation voltage; therefore, it achieves LED brightness dimming. The
relationship between the duty cycle and FB voltage is given by Equation 2.
Where
  Duty = duty cycle of the PWM signal
  200 mV = internal reference voltage

可以直接给高电平,这样Vfb就是200mV
根据手册I-LED=Vfb/Rset=200mv/10欧=20ma

也可以给PWM信号,频率在10-40Khz之间,通过占空比来控制Vfb=duty*200mv
根据手册I-LED=Vfb/Rset=duty*200mv/10欧=duty*20ma
The CTRL pin is used for the control input for both dimming modes, PWM dimming and 1 wire dimming. The dimming mode for the TPS61160/1 is selected each time the device is enabled. The default dimming mode is PWM dimming.

To enter the 1 wire mode, the following digital pattern on the CTRL pin must be recognized by the IC every time the IC starts from the shutdown mode.
  1. Pull CTRL pin high to enable the TPS61160/1, and to start the 1 wire detection window.
  给CTRL引脚一个持续的上拉,之后会进入单总线检测窗口期
  2. After the EasyScale detection delay (tes_delay, 100µs) expires, drive CTRL low for more than the EasyScale detection time (tes_detect, 260µs).
在EasyScale检测延迟(detection delay)(tes_延迟,100微秒)到期后,再给CTRL一个超过(detection time)260us的低电平,过了260us的detection time后就进入ES(EasyScale )模式窗口期了,给一个高电平就会进入ES模式
  3. The CTRL pin has to be low for more than EasyScale detection time before the EasyScale detection window (tes_win, 1msec) expires. EasyScale detection window starts from the first CTRL pin low to high transition.
满足以上三个条件就会进入单总线模式
The IC immediately enters the 1 wire mode once the above 3 conditions are met. the EasyScale communication can start before the detection window expires. Once the dimming mode is programmed, it can not be changed
without another start up. This means the IC needs to be shutdown by pulling the CTRL low for 2.5ms and
restarts. See the Dimming Mode Detection and Soft Start (Figure 13) for a graphical explanation.
image.png

1.先把背光调出来,根据原理图,背光芯片是tps61160,第五脚名字为CTRL,是一个多功能引脚(高电平使能芯片),接的是GPIO1_IO15。


GPIO复用寄存器

定义在uboot目录/arch/include/dt-bindings/pinctrl/pins-imx8mm.h
或者内核目录./include/dt-bindings/pinctrl/pins-imx8mm.h

MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15
这个定义就是把(GPIO1_IO15)这个PAD复用成GPIO1_IO15
这样直接给高电平,背光就会一直亮。

MX8MM_IOMUXC_GPIO1_IO15_PWM4_OUT
这个定义就是把(GPIO1_IO15)这个PAD复用成PWM4
这样可以根据占空比来控制背光亮度。

image.png

我们需要把这个GPIO改为输出高电平,这样屏幕背光就会点亮了。
看上面的图,想要配置成上拉模式的话,需要把PE PS设置为11。


输入模式

速率

找到pad ctrl寄存器

根据上图可知,PE就是用来控制PE的,HYS是用来控制IS的,PUE控制PS,所以我们需要把PE=1 HYS=0 PUE=1 ODE=0 FSEL=1X DSE=01X 注意DSE决定了驱动强度,过强会导致信号过冲,过弱会导致信号上升/下降时间过长。

0x152

所以我们想输出高电平的话,最后的配置就是

MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15    0x152

MX8MM_IOMUXC_SAI5_RXFS_GPIO3_IO19

你可能感兴趣的:(IMX8MM-LCD-ILI9806E调试流程)