Detailed explanation of MSP430 system clock

Publisher:qinghongLatest update time:2014-12-23 Source: 51heiKeywords:MSP430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
After power-on reset, DCO is about 800KHz
 
The basic clock of SP430 series microcontrollers is mainly composed of low-frequency crystal oscillators, high-frequency crystal oscillators, digitally controlled oscillators (DCO), frequency-locked loops (FLL) and FLL+ modules. The clock modules will also be different due to the different models of 430 series microcontrollers. Although the time base modules of different models of microcontrollers are different, the results generated by these modules are the same. There is a TX2 oscillator in MSP430F13 and 14, while LFXT1CLK is used to replace the XT2CLK clock signal in MSP430F11X and F11. There are 3 (for F13 and F14) time signal sources (or 2 clock signal sources for F11X and F11X1) in the clock module:  
 
1-LFXT1CLK: Low frequency/high frequency clock source. It is connected to an external crystal oscillator without the need for two external oscillation capacitors. The commonly used crystal oscillator is 32768HZ.
 
2-XT2CLK: High frequency clock source. It is an external crystal oscillator. Two external oscillation capacitors are required. The most common crystal oscillator is 8MHZ.
 
3-DCOCLK: Digitally controllable RC oscillator.  
 
 
 
The default clock source for the microcontroller when it is powered on is the DCO clock, because as long as it is within the normal operating voltage, the DOC will provide a stable clock source.
 
After the PUC signal, DCOCLK is automatically selected as the MCLK clock signal. The clock source of MCLK can be set to LFXT1 or XT2 as needed. The setting sequence is as follows:
 
1. Reset OscOff
 
2. Clear OFIFG
 
3. Delay waiting for at least 50us
 
4. Check OFIFG again. If it is still set, repeat steps 3 and 4 until OFIFG = 0.
 
 
 
The MSP430 microcontroller clock module provides three clock signal outputs for use by various circuits within the chip.  
 
1-ACLK: Auxiliary clock signal. As shown in the figure, ACLK is obtained by dividing the FLXT1CLK signal by 1/2/4/8 dividers. The division factor is determined by setting the DIVA corresponding to the BCSCTL1 register. ACLK can be used to provide CPU peripheral function modules as clock signals.  
 
2-MCLK: Main clock signal. As shown in the figure, MCLK is provided by 3 clock sources. They are LFXT1CLK, XT2CLK (F13, F14, if it is F11, F11X1, it is replaced by LFXT1CLK), and DCO clock source signal. MCLK is mainly used as clock for MCU and related system modules. Related registers can also be set to determine the frequency division factor and related settings.  
 
3-SMCLK: Subsystem clock, SMCLK is provided by 2 clock source signals. They are XT2CLK (F13, F14) and DCO. If it is F11, F11X1, LFXT1CLK will replace TX2CLK. You can also set the relevant registers to determine the frequency division factor and related settings.
 
 
 
Principle description of clock generator:
 
Problem: 1. High frequency, so as to respond quickly to system hardware requests and events
 
            2. Low frequency to minimize current consumption
 
            3. Stable frequency to meet the application of timer.
 
            4. Low Q value oscillator to ensure no delay in starting or stopping operation
 
MSP430 adopts a compromise method: using a low-frequency crystal oscillator to multiply it to a high-frequency operating frequency. Generally, there are two practical methods to use this technology, one is the phase-locked loop, and the other is the frequency-locked loop. The phase-locked loop uses analog control, which is easy to cause "loss of lock" and change in capacitance. TI uses the frequency-locked loop technology, which uses a digital controller DCO and frequency integration to generate a high-frequency operating clock frequency.
 
 
 
Tips for low power settings:
 
1. LPM4: During the oscillator shutdown mode, all parts of the processor stop working, and the current consumption is minimal. At this time, it will only work again when the system power-on circuit detects a low level or any external interrupt event that requests an asynchronous response interrupt. Therefore, the design should include external interrupts that may be needed to use this mode. Otherwise, unpredictable results may occur.
 
2. LPM3: During the DC generator shutdown period, only the crystal oscillator is active. However, the DC current of the DC generator that sets the basic timing conditions is turned off. Due to the high-impedance design of this circuit, power consumption is suppressed. Note: It takes a certain amount of time (ns-us) from DC shutdown to DC0 startup
 
3. LPM2: During this period, the crystal oscillator and DC generator are working, so a quick start can be achieved.
 
4. LPM1: The oscillator is already working here, so there is no startup time delay problem.
 
             
 
In combination with the above characteristics, when writing programs, you must comprehensively consider the low power consumption characteristics, and the arrangement of external events is also very important. You must comprehensively consider the function implementation to achieve your expected effect. Using C language, you can use the following statements: _BIS_SR (LMP3_bits) and _BIC_SR (LPM3 bits)
 
#include  
 
#include  "BoardConfig.h"
 
void DelayMs(unsigned int ms)
 
{
 
  unsigned int i;
 
  while(--ms)
 
  {
 
    for(i=110;i>0;--i);
 
  }
 
}
 
void main(void)
 
{
 
  volatile unsigned int i;
 
 
 
  BoardConfig(0xb0);
 
  WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
 
  P5DIR |= 0x10;                            // P5.4= output direction
 
  P5SEL |= 0x10;                            // P5.4= MCLK option select
 
  BCSCTL1 &= ~XT2OFF;                       // XT2= HF XTAL
 
  P2DIR |= 0xff;
 
 do
 
  {
 
  IFG1 &= ~OFIFG; // Clear OSCFault flag Clear oscillator failure flag
 
  for (i = 0xFF; i > 0; i--);       // Time for flag to set
 
  }
 
  while ((IFG1 & OFIFG)); // OSCFault flag still set? Using an external clock will be much faster
 
  BCSCTL2 |= SELM_2;       // MCLK= XT2 (safe)
 
  for (;;)                    // Do nothing
 
  {
 
    P2OUT = ~P2OUT;
 
    DelayMs(10000); // Using an external clock will be much faster
 
  }
 
}
Keywords:MSP430 Reference address:Detailed explanation of MSP430 system clock

Previous article:Note on issues when using parallel port JTAG to simulate downloading of MSP430
Next article:msp430 sets the basic clock system

Recommended ReadingLatest update time:2024-11-17 03:37

Multi-channel wireless temperature detection system based on MSP430 single chip microcomputer
0 Introduction Temperature plays an extremely important role in human daily life. At the same time, temperature detection is of great significance in the process of industrial and agricultural production. At present, temperature detection is mainly wired fixed-point temperature detection. The principle of temper
[Microcontroller]
Multi-channel wireless temperature detection system based on MSP430 single chip microcomputer
The necessity of learning MSP430
1. Advantages of 430 • Low power consumption, ultra-low power consumption, it has one active mode and five low power modes. In active mode, the power consumption is only 250us/MIPS, and the maximum leakage current of the I/O input port is only 50nA. • It has powerful data processing capabilities and uses a RISC (reduc
[Microcontroller]
The necessity of learning MSP430
Use of MSP430 MCU Watchdog
1. The watchdog has three working modes: stop mode, timer mode and watchdog mode. 2. The clock sources that can be selected in the latter two modes are: SMCLK and ACLK. 3. When using the last two modes, pay attention to whether the watchdog can work under the state of the MCU. For example, when the MCU is in LPM3,
[Microcontroller]
Design of cardiopulmonary auscultation skills training system based on MSP430
Based on the development of modern medical simulation teaching, the cardiopulmonary auscultation skill training system based on MSP430 has changed the past use of radio frequency and special stethoscopes to imitate the cardiopulmonary auscultation process, and the operation is more realistic in the clinical real env
[Microcontroller]
Design of cardiopulmonary auscultation skills training system based on MSP430
Infrared remote control decoding based on MSP430
          There are many special chips for remote control transmitters, which can be divided into two categories according to the encoding format. Here we will use the one that is more widely used and easier to decode to explain. Now we will take the Japanese NEC uPD6121G transmitter circuit as an example to explain th
[Microcontroller]
Infrared remote control decoding based on MSP430
Problems with defining very large arrays in MSP430
The IAR compilation method causes the watchdog to overflow. The watchdog is already started when the microcontroller is powered on, but before entering the main function, the software will first initialize some of the data you use, such as arrays. If your array is defined to be large, the initialization time will be ve
[Microcontroller]
MSP430 drives DDS module AD9851
#include "msp430x14x.h"      #define ad9581_w_clk P2DIR|=BIT0 //Write clock signal to P2.0 port   #define ad9581_w_clk_H P2OUT|=BIT0 //P2.0 outputs high level   #define ad9581_w_clk_L P2OUT&=~BIT0 //P2.0 outputs low level      #define ad9851_fq_up P2DIR|=BIT1 //Write frequency value to P2.1 port   #define ad9
[Microcontroller]
Clock signal of MSP430 microcontroller
  MSP430 has three clock signals: MCLK system main clock; SMCLK system sub-clock; ACLK auxiliary clock.      (1) MCLK system main clock. In addition to the CPU operation using this clock, peripheral modules can also use it. MCLK can select the clock signal generated by any oscillator and divide it by 1, 2, 4, or 8 as
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号