LP5569 Programming
31
SNVU564A – July 2017 – Revised August 2017
Copyright © 2017, Texas Instruments Incorporated
Using the BOOST-LP5569EVM Evaluation Module
3.4
Directives
The directives are not translated directly in the LP5569 device. Instead, directives are instructions for the
LASM.exe assembler. Directives are used to adjust the location of the engine 1, 2, and 3 programs in
memory and reserve memory resources in the LP5569 SRAM. For example, .segment program1 is a
directive which tells the assembler that whatever follows is the program for the program execution
engine 1. An overview of the directives is given in the following table.
Table 3. Directives
DIRECTIVE
DESCRIPTION
EXAMPLE SOURCE CODE
.segment
Adjust the location of the programs in
SRAM. Note the leading dot
segment name of engine1 is program1
segment name of engine2 is program2
segment name of engine3 is program3
.segment program1
.segment program2
.segment program3
ds
Define Storage. The directive reserves
memory resources in the SRAM. The ds
directive takes one parameter, which is
the number of words to reserve. The
number of bits in a word (word length) is
16. The allocated words are initialized with
zeros.
ds 3
ds 17
dw
Define constant Word. Inserts a binary
word to the SRAM.
dw 0000000011111111b
dw FFABh
dw 3
3.5
Labels
A label is a symbolic address. Labels are used to mark program line(s), like in a branch instruction or
when labeling rows in amapping table. Labels must have the colon (:) suffix.
Table 4. LED Driver Instructions
INSTRUCTION
SYNTAX
FUNCTION
EXAMPLE
16-BIT ASSEMBLED
BIT SEQUENCE
ASSEMBLED CODE
(HEX)
ramp time, PWM
Time is a positive
constant (0.000484 ×
PWM); PWM is a
positive or negative
constant (–255 to 255).
Note: time is rounded by
the assembler if needed.
Output PWM with
increasing or decreasing
duty cycle.
ramp 0.6, 255;
Ramp up to full scale
over 0.6 s.
0000 1010 1111 1111
0AFF
ramp 1.2, –255;
Ramp down to zero over
1.2 s.
0001 0101 1111 1111
15FF
ramp var1, prescale,
var2
Var1 is a variable (ra, rb,
rc, rd); Prescale is a
boolean constant (pre=0
or pre=1); Var2 is a
variable (ra, rb, rc, rd).
Output PWM with
increasing or decreasing
duty cycle.
ld ra, 31 ld rb, 255 ramp
ra, pre=0, +rb;
Ramp up to full scale
over 3.9 s.
1000 0100 0000 0001
8401
ld ra, 1; ld rb, 255p;
ramp ra, pre=0, -rb;
Ramp down to zero over
0.12 s.
1000 0100 0001 0001
8411
set_pwm PWM
PWM is a constant
(0–255 or 0–FFh).
Generate a continuous
PWM output.
set_pwm 128;
Set PWM duty cycle to
50%.
0100 0000 1000 0000
4080
set_pwm var1
Var1 is a variable (ra, rb,
rc, rd).
Generate a continuous
PWM output.
ld rc, 128; set_pwm rc;
Set PWM duty cycle to
50%.
1000 0100 0110 0010
8462
wait time
Time is a positive
constant (0 to 0.484).
Note: time is rounded by
assembler if needed.
Pause for some time.
wait 0.25;
Wait 0.25 seconds.
0110 0000 0000 0000
6000