MSP430 Clock Settings (Part 2)

Publisher:Yinyue1314Latest update time:2016-08-02 Source: eefocusKeywords:MSP430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Example Analysis: 
 
1. The CPU runs under the VLO clock: 
 
This is the slowest clock, running at about 12 kHz. Therefore, we will visualize the LED flashing red slowly at a rate of about every 3 seconds. 
We can let the clock system default to this state and set it up specifically to operate VLO. We will not use any ALCK peripheral clocks in this lab, 
but you should realize that ACLK comes from the VLO clock. 
 
 
#include  
 
void main(void) 
 

 
    WDTCTL = WDTPW + WDTHOLD; 
    turn off the watchdog timer 
 
    P1DIR = 0x40; 
    configure output 
 
    P1OUT = 0; 
    turn off LED 
 
    BCSCTL3 |= LFXT1S_2; 
 
    IFG1 &= ~OFIFG; 
    clear OSCFault flag 
 
    __bis_SR_register(SCG1 + SCG0); 
    turn off DCO 
 
    BCSCTL2 |= SELM_3 + DIVM_3; 
 
    while(1) 
 
    { 
 
        P1OUT = 0x40; 
        turn on LED 
 
        _delay_cycles(100); 
 
        P1OUT = 0; 
        turn off LED 
 
        _delay_cycles(5000); 
 
    } 
 
Keywords:MSP430 Reference address:MSP430 Clock Settings (Part 2)

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

Latest Microcontroller Articles
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号