1222 views|0 replies

1668

Posts

0

Resources
The OP
 

MSP430F5438 study notes initialization XT1 [Copy link]

// Clock default
// FLL clock FLL selects XT1
// Auxiliary clock ACLK selects XT1 32768Hz
// Main system clock MCLK selects DCOCLKDIV 1048576Hz
// Subsystem clock SMCLK selects DCOCLKDIV 1048576Hz
#include <msp430.h>
int main(void)
{
WDTCTL = WDTPW+WDTHOLD; // Stop watchdog
P4DIR |= BIT0; // P4.0 output status

// Start XT1
P7SEL |= 0x03; // P7.0 P7.1 peripheral function
UCSCTL6 &= ~(XT1OFF); // XT1 turn on
UCSCTL6 |= XCAP_3; // internal capacitor
do
{
UCSCTL7 &= ~XT1LFOFFG; // clear XT1 error flag
}while (UCSCTL7&XT1LFOFFG); // check XT1 error flag

while(1)
{
P4OUT ^= BIT0; // flip P4.0
__delay_cycles(60000); // software delay
}
}

This post is from Microcontroller MCU
 

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