Propeller Manual

Table Of Contents
CTRA, CTRB – Assembly Language Reference
CTRA, CTRB
Register: Counter A and Counter B control registers.
DAT
Label Condition Instruction CTRA, SrcOperand Effects
DAT
Label Condition Instruction DestOperand, CTRA Effects
DAT
Label Condition Instruction CTRB, SrcOperand Effects
DAT
Label Condition Instruction DestOperand, CTRB Effects
Result: Optionally, the counter control register is updated.
Label is an optional statement label. See Common Syntax Elements, page 250.
Condition is an optional execution condition. See Common Syntax Elements, page 250.
Instruction is the desired assembly instruction. CTRA or CTRB may be used in either the
assembly instruction’s DestOperand
or SrcOperand fields.
SrcOperand is a constant expression used by Instruction to operate on, and optionally
write to, the
CTRA or CTRB register in DestOperand.
DestOperand is a constant expression indicating the register that is operated on, and
optionally written to, using the value of
CTRA or CTRB in SrcOperand.
Explanation
CTRA and CTRB are two of six registers (CTRA, CTRB, FRQA, FRQB, PHSA, and PHSB) that affect the
behavior of a cog’s Counter Modules. Each cog has two identical counter modules (A and B)
that can perform many repetitive tasks. The
CTRA and CTRB registers contain the
configuration settings of the Counter A and Counter B Modules, respectively.
CTRA and CTRB are read/write registers and can be used in either the DestOperand or
SrcOperand fields of an assembly instruction. The following code sets Counter A to NCO
mode on I/O pin 2. See Registers, page 338, and the Spin language
CTRA, CTRB section, page
95, for more information.
mov ctra, CtrCfg
CtrCfg long %0_00100_000_0000000_000000_000_000010
Page 288 · Propeller Manual v1.1