MSP430 Clock Settings (Part 4)

Publisher:郑大大Latest update time:2016-08-02 Source: eefocusKeywords:MSP430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
3. CPU running on crystal (32768Hz) and DCO clock: 
 
The slowest frequency we can run the DCO at is about 1MHz (which is also the default speed). 
Therefore, we will start by switching the MCLK to the DCO. In most systems, you will want ACLK to run on the VLO or 32768 Hz crystal. 
Since ACLK in our current code is running on the crystal, we will turn on the DCO calculation. 
 
#include  
 
void main(void) 
 

 
    WDTCTL = WDTPW + WDTHOLD; 
    turn off watchdog timer 
 
    if (CALBC1_1MHZ == 0xFF || CALDCO_1MHZ == 0xFF) 
 
    { 
 
        while(1); 
        suspend 
 
    } 
 
    BCSCTL1 = CALBC1_1MHZ; 
 
    DCOCTL = CALDCO_1MHZ; 
    set DCO mode 
 
    P1DIR = 0x41; 
    and P1.6 configure output 
 
    P1OUT = 0x01; 
    turn on 
 
    BCSCTL3 |= LFXT1S_0; 
 
    while(IFG1 & OFIFG) 
 
    { 
 
        IFG1 &= ~OFIFG; 
        clear OSCFault flag 
 
        _delay_cycles(100000); 
        delay for visible flag 
 
    } 
 
    P1OUT = 0; 
    turn off 
 
    // __bis_SR_register(SCG1 + SCG0); turn off DCO 
 
    BCSCTL2 |= SELM_0 + DIVM_3; 
 
    while(1) 
 
    { 
 
        P1OUT = 0x40; 
        turn 
 
        on_delay_cycles(100); 
 
        P1OUT = 0; 
        turn 
 
        off_delay_cycles(5000); 
 
    } 
 
Keywords:MSP430 Reference address:MSP430 Clock Settings (Part 4)

Previous article:MSP430 Clock Settings (V)
Next article:MSP430 Clock Settings (Part 3)

Recommended ReadingLatest update time:2024-11-16 15:01

MSP430 Tutorial 14: MSP430 MCU ADC12 Module
MSP430 analog-to-digital conversion module--ADC12 The ADC12 module of the MSP430 microcontroller is a 12-bit precision A/D conversion module, which has the characteristics of high speed and versatility. Most of them have built-in ADC modules. Some chips without ADC modules can also use the built-in analog comparator t
[Microcontroller]
A wireless charging circuit design using MSP430F2274
  The MSP430F2274 ultra-low power microcontroller is used as the monitoring and control core of the wireless energy transfer charger. The charging speed is selected by the switch to realize the functions of fast charging and normal charging. When the power is full, a full prompt is given and charging is automatically
[Power Management]
A wireless charging circuit design using MSP430F2274
MSP430G2553 WDT watchdog mode example
#include "io430.h" int main( void ) {   int i;   // Stop watchdog timer to prevent time out reset   WDTCTL = WDTPW + WDTHOLD;   P1DIR |= BIT0;   P1OUT &= ~BIT0; // dark   for(i=0;i 16000;i++);   P1OUT |= BIT0; //on   WDTCTL = WDT_ARST_1000; //Start the watchdog timer for 1000ms   while(1)    {      for(i=0;i 100
[Microcontroller]
About the read and write operation method of MSP430-Flash exceeding 64K
About the read and write operation method of MSP430-Flash exceeding 64K #include "msp430xG46x.h"   void WriteFlashErrorNum(void);   //----------------------------------------------------------------------   //Function: Read data from flash, just need to give the first address and the number of data to be retrieved
[Microcontroller]
MSP430F5529 (I) General I/O port settings-1
I am a beginner. If there are any mistakes or inappropriate places, please correct me. Let's learn together. I recommend a good place: TI's official MSP430 exchange community http://www.deyisupport.com/question_answer/microcontrollers/msp430/f/55.aspx . Registration is required. Ask questions here and TI's engineers
[Microcontroller]
MSP430F5529 (I) General I/O port settings-1
Implementation of wireless sensor network based on MSP430F149 and Si4432
The application field of wireless sensor network is very wide. Wireless sensor nodes are generally powered by batteries, with simple hardware structure, small communication bandwidth, and short point-to-point communication distance. Therefore, limited working time and short communication distance become two major bo
[Industrial Control]
Implementation of wireless sensor network based on MSP430F149 and Si4432
MSP430 learning notes 7-4*4 keyboard corresponding digital tube display
This routine is also a classic routine on the development board. I modified the framework of the program to make it more suitable for future calls. The specific 4*4 keyboard scanning principle is relatively basic and will not be repeated here. Here I think it is more important to develop a good habit of writing progra
[Microcontroller]
Methods to improve the flash erase and write life of MSP430G series microcontrollers
1. Comparison of the main features of embedded Flash storage media and EEPROM Electrically Erasable and Programmable Read-Only Memory (EEPROM) is a key device used in most embedded applications to store non-volatile data. It is used to save data during program execution. Flash Memory (Flash for short) is a
[Microcontroller]
Methods to improve the flash erase and write life of MSP430G series microcontrollers
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号