微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 硬件电路设计 > TI模拟硬件电路设计 > LP55231 怎么控制RGB灯

LP55231 怎么控制RGB灯

时间:10-02 整理:3721RD 点击:

需要设置哪些寄存器才能使D1-D9引脚有输出啊?

您好,关于LP55231各寄存器的详细信息请先参考规格书Table 3 及28~37页的描述。

同时下面链接中的文档可供参考:(如fig.6即为打开D1的一个简单例子)

http://www.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=snvu214&fileType=pdf

另外,如用LP55231驱动RGB灯的话,如VDD电压低于3.7V, 请留意最好用D7~D9(直接由VDD供电)来驱动R灯,而用D1~D6(由内部charge pump供电,电压更高)来驱动G/B灯。

 

 

大侠,我是想用mcu(stm32)来动态控制D1-D9引脚输出PWM波形,我已经尝试过很多的寄存器设置方式,但是就是没有输出,求具体的寄存器设置啊。

芯片手册datasheet上应该有详细描述吧,根据你需要使用的端口,然后去看对应的寄存器,上面都有介绍的。。

具体的寄存器设置是根据你的接线方式以及端口使用情况来确定的,你可以试着写写,然后有问题可以再来讨论。。

设置时候注意时序,导线连接尽可能短,减小ESL的影响。

   对于以下程序码,主要实现渐亮渐暗过程,mapping table放在program memory 的第3页,engine 1代码放在program memory的第0页,无限循环模式,但运行后开始正常,但循环一段时间后,运行异常。请赐教!

    APP_Ht16C23WriteSingle(0x64,0x00,0x40);//CHIP EN
    APP_usDelay(2000);
    APP_Ht16C23WriteSingle(0x64,0x36,0x51);//内部时钟,1.5倍


    APP_Ht16C23WriteSingle(0x64,0x4C,0x00);//ENGINE 1 Program start address
    APP_Ht16C23WriteSingle(0x64,0x4D,0x10);//ENGINE 2 Program start address
    APP_Ht16C23WriteSingle(0x64,0x4E,0x20);//ENGINE 3 Program start address
    APP_Ht16C23WriteSingle(0x64,0x01,LP5523_CMD_LOAD);//ENGINE 1 load program to SRAM, reset engine 1 PC
    APP_usDelay(2000);
   
    APP_Ht16C23WriteSingle(0x64,LP5523_REG_PROG_PAGE_SEL,0x03);//ENGINE 1 Program memory page 3
    APP_Ht16C23WriteSingle(0x64,0x50,0x01);//SRAM address 0x00  Map All Leds
    APP_Ht16C23WriteSingle(0x64,0x51,0xFF);
    APP_Ht16C23WriteSingle(0x64,LP5523_REG_PROG_PAGE_SEL,0x00);//ENGINE 1 Program memory page 0
    APP_Ht16C23WriteSingle(0x64,0x50,0x9C);//mux_map_start
    APP_Ht16C23WriteSingle(0x64,0x51,0x30);//row1 All
    APP_Ht16C23WriteSingle(0x64,0x52,0x40);//set_pwm
    APP_Ht16C23WriteSingle(0x64,0x53,0x3F);
    APP_Ht16C23WriteSingle(0x64,0x54,0x7E);//wait 484ms
    APP_Ht16C23WriteSingle(0x64,0x55,0x00);
    APP_Ht16C23WriteSingle(0x64,0x56,0x40);//set_pwm
    APP_Ht16C23WriteSingle(0x64,0x57,0x00);
    APP_Ht16C23WriteSingle(0x64,0x58,0x7E);//wait 484ms
    APP_Ht16C23WriteSingle(0x64,0x59,0x00);
    APP_Ht16C23WriteSingle(0x64,0x5A,0xA0);//Loop infinite  
    APP_Ht16C23WriteSingle(0x64,0x5B,0x00);

    APP_Ht16C23WriteSingle(0x64,0x00,0x6A);
    APP_Ht16C23WriteSingle(0x64,0x01,0x2A);//ENGINE 1 run program as defined by ENGINE1_EXEC bits.

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top