LP5569 Programming
34
SNVU564A – July 2017 – Revised August 2017
Copyright © 2017, Texas Instruments Incorporated
Using the BOOST-LP5569EVM Evaluation Module
Table 7. Data Transfer and Arithmetic Instructions
INSTRUCTION
SYNTAX
FUNCTION
EXAMPLE
16-BIT ASSEMBLED
BIT SEQUENCE
ASSEMBLED CODE
(HEX)
ld var, value
var is a variable (ra, rb,
rc);
value is a constant (0 to
255 or 0 to FFh)
Assigns a value to a
variable
ld ra, 10;
Variable A = 10.
1001 0000 0000 1010
900A
add var, value
var is a variable (ra, rb,
rc);
value is a constant (0 to
255 or 0 to FFh)
Add the 8-bit value to
the variable value.
add ra, 30;
A = A + 30.
1001 0001 0001 1110
911E
add var1, var2, var3
var1 is a variable (ra, rb,
rc);
var2 is a variable (ra, rb,
rc, rd);
var3 is a variable (ra, rb,
rc, rd).
Add the value of var3 to
the value of var2 and
store the result in var1.
add ra, rc, rd;
A = C + D.
1001 0011 0000 1010
930B
sub var, value
var is a variable (ra, rb,
rc);
value is a constant (0 to
255 or 0 to FFh)
Subtract the 8-bit value
from the variable value.
sub ra, 30;
A = A – 30
1001 0010 0001 1110
921E
sub var1, var2, var3
var1 is a variable (ra, rb,
rc);
var2 is a variable (ra, rb,
rc, rd);
var3 is a variable (ra, rb,
rc, rd).
Subtract the value of
var3 from the value of
var2 and store the result
in var1.
sub ra, rc, rd;
A = C – D
1001 0011 0001 1011
931B
3.7
Programming Examples
This is a demonstration example to display a slow ramp of all three colors for each tri-color LED.
Table 8. Example .src file
Label/Seg
INSTRUCTION
PARAMETERS
ENG1:
dw
0000 0001 0001 0001b
ENG2:
dw
0000 0000 1000 1100b
ENG3:
dw
0000 0000 0110 0010b
ALL:
dw
0000 0001 1111 1111b
.segment
program1
map_addr
ALL
set_pwm
0
map_addr
ENG1
trigger
s{2|3}
loop1:
ramp
2, 255
ramp
2, –255
ramp
2, -255
branch
0, loop1
rst
.segment
program2
trigger
w{1}
map_addr
ENG2