Propeller Manual

Table Of Contents
3: Assembly Language Reference – CLKSET
Propeller Manual v1.1 · Page 271
CLKSET
Instruction: Set the clock mode at run time.
CLKSET Mode
Mode (d-field) is the register containing the 8-bit pattern to write to the CLK register.
Opcode Table:
–INSTR– ZCRI –CON– –DEST– –SRC– Z Result C Result Result Clocks
000011 0001 1111 ddddddddd ------000
--- --- Not Written 7..22
Concise Truth Table:
In Out
Destination Source
1
Z
C
Effects
Destination
2
Z C
$0000_006F; 111 %0_00000000; 0 -
-
wr wz wc
$0000_0007; 7 0 0
1
The Source is automatically set to immediate value 0 by the assembler to indicate that this is the CLKSET hub instruction.
2
Destination is not written unless the WR effect is given.
Explanation
CLKSET changes the System Clock mode during run time. The T CLKSET instruction behaves
similar to the Spin command of the same name (see
CLKSET 71T on page ) except that it only
sets the clock mode, not the frequency.
After issuing a
CLKSET instruction, it is important to update the System Clock Frequency
value by writing to its location in Main RAM (long 0):
WRLONG freqaddr, #0. If the System
Clock Frequency value is not updated, other objects will misbehave due to invalid clock
frequency data.
CLKSET is a hub instruction. Hub instructions require 7 to 22 clock cycles to execute
depending on the relation between the cog’s hub access window and the instruction’s moment
of execution. See on page for more information.
T
Hub 24