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

8..23

Concise Truth Table:

In

Out

Destination

Source1

Z

C

Effects

Destination2

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 CLKSET instruction behaves similar to the Spin command of the same name (see CLKSET) 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 8 to 23 clock cycles to execute depending on the relation between the cog's hub access window and the instruction's moment of execution. See Hub for more information.

 –INSTR–        ZCRI       –CON–          –DEST–                –SRC–

Unless otherwise noted, content on this site is licensed under the
Creative Commons Attribution-ShareAlike 4.0 International License.