TLC59401 的总结

来源:互联网 发布:百帝王啤酒知乎 编辑:程序博客网 时间:2024/06/16 12:21

 

一、芯片的引脚定义以及作用

31: BLANK   When BLANK is high, all OUTn outputs are forced OFF. GS counter is also reset.

When BLANK is low, OUTn are controlled by the grayscale PWM control.

24: GSCLK   Reference clock for grayscale PWM control (由TIME3提供方波)

1: SCLK   Serial data shift clock  (为SIN的写入提供输送 SCLK)

2: SIN     Serial data input  (高电平写入的为1低电平写入的为0)

23: SOUT   Serial data output

3: MODE   Input mode-change pin. When MODE = GND, the device is in GS mode. When MODE = VCC, the device is in DC mode.

32: XLAT    Level triggered latch signal. When XLAT is high, the TLC59401 writes data from the input shift register to either GS register (MODE is low) or DC register (MODE is high).   When XLAT is low, the data in the GS or DC registers are held constant and do not change.

 

 

 

二、两种重要的模式GS MODEDC MODE

3: MODE   Input mode-change pin. When MODE = GND, the device is in GS mode. When MODE = VCC, the device is in DC mode.

 

 

the GS data must be set before the DC data is set.(设置GS数据之前必须设置DC数据)

 

XLAT must be low when the MODE pin goes high-to-low or low-to-high to change back and forth between GS mode and DC mode.

 

1、  SETTING DOT CORRECTION

The TLC59401 has the capability to fine-adjust the output current of each channel (OUT0 to OUT15) independently.(每个灯的电流都可以独立控制)

 

Each of the 16 channels can be programmed with a 6-bit word.(63级) 6-bit*16 = 96bit. 每个灯的控制点占用6bit。

The channel output can be adjusted in 64 steps from 0% to 100% of the maximum output current Imax.

(共有64级灯亮的控制)

 

 

 

在设计计算机系统的时候,有两种处理内存中数据的方法。一种叫为little-endian,存放在内存中最低位的数值是来自数据的最右边部分(也就是数据的最低位部分)

Big-Endian format 最低位来自最左边的数据。

 

数据的传输形式:

The format is Big-Endian format. In this format, the MSB is transmitted first, followed by the MSB-1, etc.

 

 

 

相关代码的实现:

 

if(type == DC_MODE)

{

   for(uint8_t i = 0; i < 16; i++)  //

   {

      dc_data = p_tlc->led_dc_data_buff[15-i];

      for(uint8_t t = 0; t < 6; t++)

      {

         if(dc_data & 0x20)

         {

             HAL_GPIO_WritePin(IR_SIN_GPIO_Port,IR_SIN_Pin,GPIO_PIN_SET);

                                HAL_GPIO_WritePin(IR_SCLK_GPIO_Port,IR_SCLK_Pin,GPIO_PIN_SET);  //

                                      HAL_GPIO_WritePin(IR_SCLK_GPIO_Port,IR_SCLK_Pin,GPIO_PIN_RESET);

         }

         else

         {

                    HAL_GPIO_WritePin(IR_SIN_GPIO_Port,IR_SIN_Pin,GPIO_PIN_RESET);

                                HAL_GPIO_WritePin(IR_SCLK_GPIO_Port,IR_SCLK_Pin,GPIO_PIN_SET);

                                  HAL_GPIO_WritePin(IR_SCLK_GPIO_Port,IR_SCLK_Pin,GPIO_PIN_RESET);

          }

                dc_data = dc_data << 1;

       }

           

  }

  }

 

 

 

 

 

2、SETTING GRAYSCALE

 

The use of 12 bits per channel results in 4096 different brightness steps, from 0% to 100% brightness.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3、GRAYSCALE PWM OPERATION

 

The first GSCLK pulse after BLANK goes low increases the grayscale counter by one and switches on all OUTn with a grayscale value not equal to zero.

 

Each following rising edge of GSCLK increases the grayscale counter by one.

 

The TLC59401 compares the grayscale value of each output OUTn with the grayscale counter value. All OUTn with grayscale values equal to the counter values are switched off.

 

 

 

 

 

Output On-Time

 

 

 

 

 

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 苹果手机和助理打不开怎么办 苹果我的世界打不开怎么办 ps试用7天到期了怎么办 皮肤锁不住水份怎么办 硫酸弄到皮肤上怎么办 直播时图像反看怎么办 快手直播权限被收回怎么办 快手直播权限被收回了怎么办 腾讯手游助手玩游戏卡怎么办 电脑直播视频打不开了怎么办 平板进水开不了机怎么办 苹果平板进水开不了机怎么办 苹果平板电脑进水了怎么办 电脑换主机以前的文件怎么办 货车卖了没过户怎么办 微交易出金不了怎么办 直播时出现央视影音客户端怎么办 qq账号暂时无法登录怎么办 饿了吃东西胃疼怎么办 早上不吃饭胃疼怎么办 孕晚期胃疼呕吐怎么办 胃疼了一晚上怎么办 微信视频图像倒立怎么办 ps链接图层锁定怎么办 慕课过时间了怎么办 异地恋又要考研怎么办 阴阳师手机绑定上限了怎么办 高考口令卡丢了怎么办 网易将军令换手机了怎么办 须弥bb有弱点土怎么办 战网密码忘记了怎么办 梦三账号忘了怎么办 快手手机号被注册了怎么办 快手该手机号已注册怎么办 手机号被别人注册了快手怎么办 快手显示手机号已注册怎么办 163的邮箱忘了怎么办 河长制账号密码忘了怎么办 网易登录名忘了怎么办 网易通行证安全手机忘了怎么办 美团数据获取失败怎么办