MSP430 Clock Analysis

Publisher:神光骑士Latest update time:2016-08-15 Source: eefocusKeywords:MSP430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
I recently started to learn MSP430. Among all the single-chip microcomputers, clock setting is undoubtedly the most basic task! Especially for the current single-chip microcomputer, there are two kinds of low-speed and high-speed crystal oscillators outside, and there is also an internal clock source of PLL inside. Setting the clock of the system is the perfect start of the work.
     I have used two series of 430 single-chip microcomputers, MSP430F149 and MSP430F437. The clock settings are slightly different for different series. Let's talk about the clock of 149 step by step!
     In f149, the basic clock is called basic clock module, which
     has three clock sources:
          one LFXT1CLK, which is a low-speed/high-speed crystal oscillator source, usually connected to 32.768khz, can also be connected to (400khz~8Mhz)
          one is XT2CLK, an external standard high-speed crystal oscillator, usually connected to 8Mhz, can also be connected to (400khz~8Mhz)      
         and another one is called DCOCLK, which is an internal crystal oscillator, composed of an RC oscillation circuit.
    There are three clock systems in 430. 
        One is ACLK, which is usually based on LFXT1CLK as the clock source. The frequency division system tree of the clock can be controlled by software.     
       One is MCLK, which is the Main CLK. It is the main clock unit that provides the clock for the system core. It can be selected from three clock sources by software.
       One is SMCLK, which is called the auxiliary main clock. The clock source can also be selected by software.
Basic Clock Module Registers (Basic Clock Registers)
DCO control register DCOCTL
Basic clock system control 1 BCSCTL1
Basic clock system control 2 BCSCTL2
SFR interrupt enable register 1 IE1
SFR interrupt flag register 1 IFG1
The DCOCTL register is used to configure DCOCLK.
BCSCTL1 and BCSCTL2 registers are more important. These two registers control the working clock system of 430 in your entire system.
BCSCTL1 register:
    7 6 5 4 3 210
XT2OFF XTS DIVAx XT5V RSELx
XT20FF: Used to control the opening and closing of the XT2 crystal oscillator, set to 1 to close, set to 0 to open
XTS: Used to select the working mode of the low-speed crystal (can be ignored)
DIVAx: Used to select the division coefficient of ACLK
XT5V: Not used
RSELx: Select the resistor (not used, usually set to 0)
BCSCTL2
7 6 5 4 3 2 1 0
SELMx DIVMx SELS DIVSx DOCR
SELMx: Select the clock source of MCLK,
00 DCOCLK  
01 DCOCLK  
10 XT2CLK  
11 LFX1CLK
DIVMx: MCLK division
00 1 division
01 2 division
10 4 division
11 8-division
SELS: clock source of SMCLK, built-in DCO at 0, external high-speed XT2 at 1
DIVSx: frequency division of SMCLK, same as MCLK frequency division
DCOR: whether the resistor controlling the frequency is internal or external (never used)
Example initialization program
void Init_CLK(void)
{
   unsigned int i;
   BCSCTL1=0x00; //XT2 is turned on, LFXTCLK is in low-frequency mode, ACLK frequency division is 0
  do
  {
      IFG1&=~OFIFG;
     for(i=0x20;i>0;i--);
  }
   while((IFG1&OFIFG)==OFIFG); //When OSCFault=1, that is, the crystal oscillator does not oscillate, wait
   BCSCTL2=0X00;
   BCSCTL2|=SELM1; //MCLK clock is XT2,
   BCSCTL2|=SELS; //SMCLK clock is XT2
}
Keywords:MSP430 Reference address:MSP430 Clock Analysis

Previous article:msp430 a c program for setting the reference voltage of AD digital-to-analog conversion
Next article:Example of infrared decoding using CCR1 capture mode of MSP430 TimerA

Recommended ReadingLatest update time:2024-11-16 21:30

MSP430G2553 1602 display characters
I checked a lot on the Internet; many people said that it would be easy to use after downloading it, but it was useless. I will write this for myself to read later. It is not very standardized, just for reference. It should be OK to download it, but it is very dark under 3.3V power supply. And 2553 only has a few IO p
[Microcontroller]
Design of electronic automobile speed limiter based on MSP430 microcontroller
There are hundreds of thousands of traffic accidents in China every year. If the speed limiter can be popularized, the traffic accident rate will be reduced, thus saving unnecessary property and life losses. Compared with the electronic dog products that are popular in the market recently, the speed limiter has
[Microcontroller]
Design of electronic automobile speed limiter based on MSP430 microcontroller
MSP430 MCU RTC-Real Time Clock
  RTC-Real Time Clock is a real-time clock module for 430 microcontrollers. It can be configured as a real-time clock mode (perpetual calendar) or a general-purpose 32-bit counter mode. The real-time clock mode provides year, month, day, hour, minute, and second. You can choose BCD code or binary format, and it has a
[Microcontroller]
12864 LCD In-depth Study Notes_2——Based on msp430g2553
7. The following code is to control the LCD to display the picture in full screen. The code is as follows: //Program function: Display two pictures on the 12864 LCD, one is a negative code picture and the other is a positive code picture //  *  I have tried this program and it works.  The LCD is controlled     by tw
[Microcontroller]
A personal in-depth understanding of MSP430-AD12
1. Is the internal AD of msp430 stable? Answer: I checked a lot of information on the Internet, which said that the internal AD of msp430 is not very stable. The first method: I added a 1.25V reference source to the AD channel as the source to be measured (430 uses an internal clock, an internal reference source o
[Microcontroller]
MSP430F249IIC
/****************************************************************** **                                                        **  File: IIC.c     | IIC Communication |                                     **  Version: 1.0      **  Description : 430 WRITE AND READ 24C02  VIA IIC BUS                                      
[Microcontroller]
Design of photoelectric micro-loss blood glucose monitoring system based on MSP430
The World Health Organization pointed out in a 2007 report that there are currently 170 million patients with diabetes mellitus (DM) in the world, and it is predicted that this number will increase dramatically to 299 million by 2025. Diabetes has become the fifth leading cause of death in the world
[Microcontroller]
Design of photoelectric micro-loss blood glucose monitoring system based on MSP430
MSP430G2553 flash operation example
/* Actually applicable to MSP430x2xx series MCU, including the following 10 commonly used functions:  (1) Initialization. Flash_Init (unsigned char Div, unsigned char Seg): Set the Flash timing according to the SMCLK frequency. The frequency division coefficient of the clock is determined by the Seg segment number to
[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号