80
9.5 Loops and triggers
The example below shows how to configure a counter, control it with
table flags, and use it as a loop condition.
# configure the counter
EXTIO,MODE,1,HSB,READ
EXTIO,COUNTER,1,HS1,FALLING
# create the table
MODE,1,TPA
TABLE,CLEAR,1
TABLE,XPARAM,1,POW
TABLE,APPEND,1,POW,-5dBm,100ns,CA1S
TABLE,APPEND,1,POW,0dBm,16ns
TABLE,LOOP,1,-1,0,COUNT,IOA1,1000
TABLE,APPEND,1,POW,-30dBm,16ns,CA1P
# run the table
TABLE,START,1
# wait for completion then read back the count
SLEEP,10
TABLE,STATUS,1
EXTIO,COUNTER,1,HS1,READ
Listing 9.5: Demonstration of configuring
ling it in advanced table mode.
Loops and triggers can be specified in advanced table mode us-
TABLE,LOOP
ing the
However, some different restrictions apply to loops in advanced table
mode:
• Nested loops are not supported
• Neither the first nor last table instruction can be a loop
• The
TABLE,LOOP
that uses the
• A loop cannot jump by more than 1024 instructions
• The loop condition can specify up to 65535 repeats
• Sequential instructions may contain loops, unlike
where loops need to be separated by four instructions.
Chapter 9. Advanced table mode (XRF)
# set bank A into read mode
# set pin A1 to count falling edges
# start the counter
# accumulate counts
# loop until 1000 counts
# pause the counter
command similarly to simple table mode (§8.4).
command cannot be applied to a table entry
EXTRAPOLATE
feature (§9.6)
HSA1
as a counter and control-
TSB
mode
Need help?
Do you have a question about the ARF021 and is the answer not in the manual?