You are on page 1of 11

SESSION 4

Clocks

Clock Sources:
LFXT1CLK : Low-frequency/high-frequency oscillator
supports 32KHz external crystal in LF mode (XTS=0). Appropriate
capacitance can be selected.
supports high speed crystal in HF mode (XTS=1, XCAPx=00 (cap setting))
supports use of external clock
LFXT1 can be disabled if it is not sourcing SMCLK or MCLK by setting OSCOFF

XT2CLK : Optional high-frequency oscillator


DCOCLK :
It is an integrated digitally controlled oscillator
Built-in DCO with configurable range from 100KHz to 4MHz

Clock Signals:
ACLK: Auxiliary clock.
The signal is sourced from LFXT1CLK with a divider of 1, 2, 4, or 8.
ACLK can be used as the clock signal for Timer A and Timer B.
ACLK can be divided by 1, 2, 4, or 8. ACLK is software selectable for individual
peripheral modules.

MCLK: Master clock.


The signal can be sourced from LFXT1CLK, XT2CLK (if available)
MCLK is divided by 1, 2, 4, or 8.
MCLK is used by the CPU and system.

SMCLK: Sub-main clock.


The signal is sourced from either XT2CLK (if available), or DCOCLK with a
divider of 1, 2, 4, or 8.
SMCLK can be used as the clock signal for Timer A and Timer B
SMCLK is software selectable for individual peripheral modules.

Clock System Registers


DCOCTL,DCO control register
Used to setup the DCO to a specific frequency

BCSCTL1
BCSCTL1:
This register is to
select the source of
ACLK and also used
to set DCO
Default value on
reset is 0x87h (1000
0111). This means
that XT2 is turned
off and LFXT1 in low
frequency mode is
selected with divider
being 1.

BCSCTL2:
The source of
MCLK and SMCLK
are selected.
The reset value
is 0000 0000.
This means that
the default
source for MCLK
and SMCLK is
DCO with divider
as 1 in both
cases.

Calibrate DCO to run at different


frequencies
MSP430 will start up around 1.2MHz for the G2553.
TI has taken each MSP430 and performed a calibration
of the DCO versus a known input frequency for several
common frequencies. These calibration values provide
DCO steps that result in a clock value as clock as
possible to the frequency.
DCO can be calibrated to

1Mhz
8Mhz
12Mhz
16Mhz

Configuring msp430 DCO to 8Mhz

How to configure MCLK,ACLK,SMCLK


to run at different frequencies
To set ACLK:
Write to BCSCTL1

To set SMCLK and MCLK


Write to BCSCTL2

You might also like