This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LP5569: How to do easing LED in specific RGB LED color

Part Number: LP5569

Hi all,

I have some questions about easing LED in specific RBG LED color.

LED1 - connected to RGB_LED (R)

LED2 - connected to RGB_LED (G)

LED3 - connected to RGB_LED (B)

I set the RGB_LED to specific blue as RGB(0, 140, 255) by configuring pwm as below.

map_sel    1

set_pwm    0

map_sel    2

set_pwm    140

map_sel    3

set_pwm    255

I want to do easing LED on this specific blue and how can I program it?

Control input current or ? (but I can't find instructions for current control)

  • Hi Kenny,

    if you only want to illuminate LEDs with specific color but no other animations need, I think you do not have to use engine function. You could directly set the PWM and current register to config the output channels 

  • Hi Hardy,

    Thanks for your prompt reply.

    I need to implement breathing(easing) LED as the requirement below, also breathing between specific blue and red.

    Could you share sample code for breathing between specific blud and red and breathing time comply with the spec below?

  • Hi Kenny,

    Let us take LED0~2 for example. First of all you should config LED0~2 current registers to get the specific blue. Then perform engine function controlling PWM to achieve breathing animation. Example code was attached below.

    D123:          	dw             	0000000000000111b   	;Map RGB LED1 on the eval. board.
                   	               	                    	 
                   	               	                    	 
    .segment       	program1       	                    	;Program for engine 1.
                   	               	                    	 
    loop1_0:       	               	                    	 
                   	               	                    	 
                   	map_start      	D123                	;Map the first LED.
                   	               	                    	 
    loop1:         	               	                    	 
                   	ramp           	1, 255              	;Increase PWM 0->100% in 1 seconds.
                   	ramp           	1, -255             	;Decrease PWM 100->0% in 1 seconds.
                   	wait           	0.4                 	;Wait for 0.4 seconds.     	                    	 
                   	branch         	0,loop1             	;Loop infinite time                            	         	 
                   	end            	                    	 
                   	               	                    	 
    .segment       	program2       	                    	 
                   	               	                    	 
                   	rst            	                    	 
                   	               	                    	 
    .segment       	program3       	                    	 
                   	               	                    	 
                   	rst  

  • Hi Hardy,

    I appreciate your help very much.

    One more question, Does it the only way to control LED current by the register?

    Is it possible to use the engine control LED current?

  • Hi Kenny,

    Sorry that engine can only control PWM of all channels. 

  • Hi Hardy,

    I also need to implement breathing between two color. (specific blue and green)

    Assume I have configured the LED0~2 current for specifically blue.

    My implementation below uses two engines to control LED1, LED2 respectively.

    My question is that can I use only one engine to control two  LED_X PWM simultaneously with different rates?

    RGB_R:         	dw             	000000001b          	 
    RGB_G:         	dw             	000000010b          	 
    RGB_B:         	dw             	000000100b          	 
    RGB_GB:        	dw             	000000110b          	 
    .segment       	program1       	                    	 
    loop1:         	               	                    	 
                   	map_start      	RGB_G               	 
                   	trigger        	s{2}                	
                   	ramp           	2.5, 255            	;Increase PWM 0->100% in 2.5 second
                   	wait           	0.4                 	
                   	ramp           	2.5, -255           	;Decrease pwm->0% in 2.5 second
                   	wait           	0.4                 	
                   	branch         	0, loop1            	 
                   	end            	                    	 
    .segment       	program2       	                    	
    loop2:         	               	                    	
                   	trigger        	w{1}                	
                   	map_start      	RGB_B               	
                   	ramp           	2.4, 190            	
                   	ramp           	0.5, -255           	
                   	wait           	0.4                 	
                   	branch         	0, loop2            	
                   	end            	                    	
    .segment       	program3    

  • Hi Kenny,

    I am afraid it also cannot be achieved by only one engine. One engine can control one group of LEDs doing the same behavior.