Propeller Manual

Table Of Contents
_CLKMODE – Spin Language Reference
_CLKMODE
Constant: Pre-defined, one-time settable constant for specifying application-level clock
mode settings.
CON
_CLKMODE = Expression
Expression is an integer expression made up of one or two Clock Mode Setting
Constants shown in Table 2-3. This will be the clock mode upon application start-up.
Explanation
_CLKMODE is used to specify the desired nature of the System Clock. It is a pre-defined
constant symbol whose value is determined by the top object file of an application. The clock
mode setting is a byte whose value is described by a combination of the
RCxxxx, XINPUT,
XTALx and PLLxx constants at compile time. Table 2-3 illustrates the clock mode setting
constants. Note that not every combination is valid; Table 2-4 shows all valid combinations.
Table 2-3: Clock Mode Setting Constants
Clock Mode
Setting
Constant
1
XO
Resistance
2
XI/XO
Capacitance
2
Description
RCFAST Infinite n/a Internal fast oscillator (~12 MHz). May be 8 MHz to 20 MHz. (Default)
RCSLOW Infinite n/a Internal slow oscillator (~20 KHz). May be 13 KHz to 33 KHz.
XINPUT Infinite 6 pF (pad only) External clock-oscillator (DC to 80 MHz); XI pin only, XO disconnected
XTAL1 2 k 36 pF External low-speed crystal (4 MHz to 16 MHz)
XTAL2 1 k 26 pF External medium-speed crystal (8 MHz to 32 MHz)
XTAL3 500 16 pF External high-speed crystal (20 MHz to 80 MHz)
PLL1X n/a n/a Multiply external frequency times 1
PLL2X n/a n/a Multiply external frequency times 2
PLL4X n/a n/a Multiply external frequency times 4
PLL8X n/a n/a Multiply external frequency times 8
PLL16X n/a n/a Multiply external frequency times 16
1. All constants are also available in Propeller Assembly.
2. All necessary resistors/capacitors are included in Propeller chip.
Page 68 · Propeller Manual v1.1