1482 views|0 replies

2015

Posts

0

Resources
The OP
 

MSP430 Learning Summary 3-MSP430 Basic Clock Module [Copy link]

Different from 51, AVR and other single-chip microcomputers, the clock signal sources of msp430 include LFXT1, XT2 and DCO.

1. LFXT1: It can connect high-speed and low-speed crystal oscillators. In low-speed mode, it can connect an external 32k crystal oscillator without load capacitors. This method is more common and is mainly used to provide a low-speed clock signal for ACLK for use by low-speed peripherals.

2. XT2: High-speed oscillator, it can connect a 0.4~16M crystal oscillator, it is equivalent to LFXT1 in high-speed mode. It is usually configured as a high-speed oscillator source to provide high-speed clock signals for MCLK and SMCLK.

3. DCO: internal digitally controlled oscillator, its frequency can be configured through DCOCLK. After the system PUC, DCOx=7, MODx=3, indicating that the highest frequency is selected.

As mentioned above, there are three clock signal sources in MSP430. The clock signals of MSP430 also have three types: main clock MCLK, subsystem clock SMCLK, and auxiliary clock ACLK.
Among them, MCLK is used for the system, SMCLK is used for high-speed peripherals, and ACLK is mainly used for low-speed peripherals.

After the system PUC, the default SMCLK and MCLK use DCO as the clock source, the oscillation frequency is about 1.1M, and ACLK uses LFXT1 as the clock source, working in LF mode with an internal 6pF load capacitor.
In general, XT2 is selected as the main clock, and the clock module initialization procedure is as follows:

Note: a. It is best to put IFG1&=~OFIFG; into a do-while loop. I adjusted the program for a while and found that IFG1 seemed to be set.

It cannot reset automatically.

b. If an error occurs on XT2, set XT2 as the clock source of MCLK SMCLK, and the MCU will automatically change the clock source.

For DCO oscillator. When the clock signal is lost for 50us, the oscillator fails. If the MCLK signal comes from LFXT1 or XT2,

Then the MSP430 automatically switches the MCLK signal to DCO, which ensures that the program continues to run.

mode of the LFXT1 to be monitored.

b.BCSCTL2=SELM_2+SELS; statement must be placed after while, because before XT2 starts to oscillate, XT2 is in error state.

Therefore, before XT2 starts to oscillate, after setting it as the main clock and subsystem clock, the MCU will automatically set DCO

Set the clock source of SMCLK to MCLK.

This post is from Microcontroller MCU
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list