linux 驱动调试笔记二----背光
2014-02-26 10:55
351 查看
2014年1月6号
遇到的问题:背光出现混乱
现象描述:背光0-255,背光从0到255,亮度出现跳变,在中间(100)可能最亮,在255
查看了一下使用的背光电源芯片资料,上边有两种调节的方法:
![](http://img.blog.csdn.net/20140226111010906)
![](http://img.blog.csdn.net/20140226111016890)
![](http://img.blog.csdn.net/20140512094449843)
根据上面的表,发的脉冲越少,输出的电流值越大,用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 600s 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 150s. However, the IC is guaranteed to be shut down after the CTRL is kept Low for at
least 600s.
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):
这个是下载生成的boot.img的一些命令:
![](http://img.blog.csdn.net/20140226111023265)
之后直接重启就可以了
遇到的问题:背光出现混乱
现象描述:背光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 600s 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 150s. However, the IC is guaranteed to be shut down after the CTRL is kept Low for at
least 600s.
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的一些命令:
之后直接重启就可以了
相关文章推荐
- linux 驱动调试笔记二----背光
- 学习笔记 --- LINUX 驱动调试之定位系统僵死
- linux 驱动调试笔记二----LCD驱动01
- 【TINY4412】LINUX移植笔记:(20)设备树LCD背光驱动
- 学习笔记 --- LINUX 驱动调试之动态设置寄存器
- 学习笔记 --- LINUX 驱动调试之根据出错PC来分析
- 学习笔记 --- LINUX 驱动调试之使用proc
- 学习笔记 --- LINUX 驱动调试之根据栈信息来分析
- linux 驱动调试笔记二----LCD驱动02
- 学习笔记 --- LINUX 驱动调试之printk
- linux设备驱动学习笔记--内核调试方法之printk
- 学习笔记 --- LINUX MTD设备之NANDFLASH驱动分析
- linux字符设备驱动-异步通知笔记
- ARM Linux内核驱动异常定位调试--反汇编arm-linux-objdump
- 关于RT2870 linux驱动Ad-Hoc模式下出错的调试
- Android驱动开发调试笔记
- linux 2.6 驱动笔记(三)
- Linux下i2c驱动调试总结
- MT6573 驱动调试笔记
- 【Linux C调试笔记】Linux系统下借助mcheck实现c/c++程序的堆内存异常检查