您的位置:首页 > 运维架构 > Linux

linux 驱动调试笔记二----背光

2014-02-26 10:55 351 查看
2014年1月6号

遇到的问题:背光出现混乱

现象描述:背光0-255,背光从0到255,亮度出现跳变,在中间(100)可能最亮,在255

查看了一下使用的背光电源芯片资料,上边有两种调节的方法:







根据上面的表,发的脉冲越少,输出的电流值越大,用Option1方法写的程序不管怎么调节,得到的背光值总是来回跳,这个暂时没找到问题在哪里?

如果使用option2,发几个脉冲就是几个脉冲,程序修改如下:

另外特别说明,芯片文档中提到需要拉低3ms,我这边测试了下,如果拉低的时间太段,芯片来不及关断的话,背光亮度会跳,所以要保证拉低的时间。

这个是背光PWM输出,这个地方也存在一个问题,就是PWM的时序,应该是高电平时间比低电平时间长才对,可是程序中的貌似低电平时间长。。。。。

控制的方式描述:

The control interface is designed for maximum design flexibility and compatibility with various types of system controls.

The simplest control is achieved by asserting a logic high on CTRL pin; this turns each output sink on to maximum LED

current set by an ISET resistor. Pulling CTRL pin low for greater than 600s will turn off the IC. The next level of

control is accomplished by injecting a series of pulses into CTRL pin to program the sink current in 64 steps. The number

of rising edges is detected internally and decoded to the current level illustrated in Table 1. T he output current levels are

evenly spaced at 1/64 of the maximum LED current, allowing excellent resolution for dimming. The final level of control

is based on the popular PWM dimming scheme which is supported via the PWM pin. Both PWM and CTRL pins can b e

used together to provide the maximum range of current steps

The current level decoding happens immediately after detecting a minimum of 200ns pulse. The first logic High or pulse

at the CTRL pin takes the current level to maximum LED current I

SET_MAX. Each subsequent qualified rising edge will

reduce the output current. See Table 1 for detailed current level versus number of pulses. The current level maintains

unchanged as long as the CTRL pin stays High. The longest low pulse guaranteed not to be mistaken as a shutdown

command should not exceed 150s. However, the IC is guaranteed to be shut down after the CTRL is kept Low for at

least 600s.

With the minimum spec of 200ns for TLOW and THIGH

for CTRL, KTD318 can interface with a signal as fast as 2.5MHz

assuming 50% duty cycle. The maximum spec for T LOW

is 150us. Assuming 50% duty cycle signal

例子(DATA = 40):

gpio_set_value(75, 1);
udelay(20);

gpio_set_value(75, 0);
udelay(20);
gpio_set_value(75, 1);
udelay(20);
for(i = 0; i < 40; i++){
gpio_set_value(75, 0);
udelay(20);
gpio_set_value(75, 1);
udelay(20);
}


这个是下载生成的boot.img的一些命令:



之后直接重启就可以了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: