Datasheet

3. Instruction Set Details
This section provides the syntax with detailed examples for all the LP5523 instructions supported by the LASM assembler.
LED DRIVER INSTRUCTIONS
INSTRUCTION SYNTAX
FUNCTION EXAMPLE 16-BIT ASSEMBLED
BIT SEQUENCE
ASSEMBLED
CODE HEX
ramp time, PWM Output PWM with
increasing / decreasing
duty cycle.
ramp 0.6, 255 0000 1010 1111 1111 0A FF
Time is a positive constant
(0.000484*PWM to
0.484*PWM);
;Ramp up to full scale over 0.6s
PWM is a positive or negative
constant (-255 to 255).
ramp 1.2,-255 0001 0101 1111 1111 15 FF
Note: time is rounded by
assembler if needed.
;Ramp down to zero over 1.2s
ramp var1, prescale, var2 Output PWM with
increasing / decreasing
duty cycle.
ld ra, 31 1000 0100 0000 0001 84 01
Var1 is a variable (ra, rb, rc, rd); ld rb, 255
Prescale is a boolean constant
(pre=0 or pre=1);
ramp ra, pre=0,+rb
Var2 is a variable (ra, rb, rc, rd). ;Ramp up to full scale over 3.9s
ld ra, 1 1000 0100 0001 0001 84 11
ld rb, 255
ramp ra, pre=0,-rb
;Ramp down to zero over 0.12s
set_pwm PWM Generate a continuous
PWM output.
set_pwm 128 0100 0000 1000 0000 4080
PWM is a constant (0-255 or 0
- FFh).
;Set PWM Duty-Cycle to 50%
set_pwm var1 Generate a continuous
PWM output.
ld rc, 128 1000 0100 0110 0010 8462
Var1 is a variable (ra, rb, rc, rd). set_pwm rc
;Set PWM Duty-Cycle to 50%
wait time Pause for some time. wait 0.25 0110 0000 0000 0000 6000
Time is a positive constant ( 0
to 0.484).
;Wait 0.25 seconds
Note: time is rounded by
assembler if needed.
AN-2227 - LP5523 Evaluation Kit
14 Copyright © 1999-2012, Texas Instruments Incorporated