1301 views|0 replies

1662

Posts

0

Resources
The OP
 

MSP430 clock frequency configuration process [Copy link]

1 XT1 clock configuration initialization
/****************************************************************************
* Function name: XT1_Config(STATUS status)
* Function description: Set whether to enable XT1
* Parameter description: STATUS status: whether to enable XT1
* Function return: None
* Example: XT1_Config(ENABLE); //Enable XT1
************************************************************************************/
static inline void XT1_Config(STATUS status)
{
if(status != DISABLE)
{
if(UCS->XT1_OFF == BIT_SET)
{
GPIO_MultiBits_Init(P5,(GPIO_Pin_4|GPIO_Pin_5),GPI|SEL); //Select XT1 Second function
UCS->XT1_OFF = RESET ; // Enable XT1
do
{
UCS->XT1_LFOFFG = RESET; // Clear XT1,CLOCK_DCO Failure flag
SFRIFG1 &= ~OFIFG; //
}while (UCS->XT1_LFOFFG == BIT_SET); //
}
}
else
{
UCS->XT1_OFF = BIT_SET ; // Turn off XT1
}
}

2 XT2 clock configuration initialization
/****************************************************************************
* Function name: XT2_Config(STATUS status)
* Function description: Set whether to enable XT2
* Parameter description: STATUS status: whether to enable XT2
* Function return: None
* Example: XT2_Config(TRUE); //Enable XT2
************************************************************************************/
static inline void XT2_Config(STATUS status)
{
if(status != DISABLE)
{
if(UCS->XT2_OFF == BIT_SET)
{
GPIO_MultiBits_Init(P5,(GPIO_Pin_2|GPIO_Pin_3),GPI|SEL); //Select CLOCK_XT2 Second function
UCS->XT2_OFF = RESET; //Enable CLOCK_XT2
do
{
UCS->XT2_OFFG = RESET;
SFRIFG1 &= ~OFIFG;
}while (UCS->XT2_OFFG == BIT_SET);
}
}
else
{
UCS->XT2_OFF = BIT_SET; // Turn off XT2
}

}

3 The internal clocks
CLOCK_VLO and CLOCK_REFO are internal clock sources and do not require configuration or initialization.

This post is from Microcontroller MCU
 

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list