Propeller Manual

Table Of Contents
2: Spin Language Reference – CLKMODE
CLKMODE
Command: Current clock mode setting.
((PUB PRI))
CLKMODE
Returns: Current clock mode.
Explanation
The clock mode setting is the byte-sized value, determined by the application at compile
time, from the CLK register. See CLK Register, page 28, for explanation of the possible
settings. For example:
Mode := clkmode
This statement can be used to set a variable, Mode, to the current clock mode setting. Many
applications maintain a static clock mode setting; however, some applications will change the
clock mode setting during run time for clock speed adjustments, low-power modes, etc. It
may be necessary for some objects to pay attention to the potential for dynamic clock modes
in order to maintain proper timing and functionality.
CLKMODE vs._CLKMODE
CLKMODE is related to, but not the same as, _CLKMODE. CLKMODE is a command that returns the
current clock mode (in the form of the CLK register’s bit pattern) whereas
_CLKMODE is an
application-defined constant containing the requested clock mode at startup (in the form of
clock setting constants that are OR’d together). Both may describe the same logical clock
mode but their values are not equivalent.
Propeller Manual v1.1 · Page 67