求助:要启动F425的高速晶振LFXT1,在软件里怎样设置

weizhou   2009-2-11 12:55 楼主
要启动F425的高速晶振LFXT1(8M),请问在软件里怎样设置?

回复评论 (5)

有22x4的,你可以参考一下,,具体到TI网上下载。



//******************************************************************************
// MSP430F22x4 Demo - Basic Clock, MCLK Sourced from HF XTAL
//
// Description: Proper selection of an external HF XTAL for MCLK is shown by
// first polling the OSC fault until XTAL is sta××e - only then is MCLK
// sourced by LFXT1. MCLK/10 is on P1.1 driven by a software loop taking
// exactly 10 CPU cycles.
// ACLK = MCLK = LFXT1 = HF XTAL, SMCLK = default DCO ~1.2MHz
// //* HF XTAL NOT INSTALLED ON FET *//
// //* Min Vcc required varies with MCLK frequency - refer to datasheet *//
//
// MSP430F22x4
// -----------------
// /|\| XIN|-
// | | | HF XTAL (3 ?16MHz crystal or resonator)
// --|RST XOUT|-
// | |
// | P1.1|-->MCLK/10 = HFXTAL/10
// | P2.0|-->ACLK = HFXTAL
//
// A. Dannenberg
// Texas Instruments Inc.
// April 2006
// Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.41A
//******************************************************************************
#include "msp430x22x4.h"

volatile unsigned int i;

void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT

P2DIR |= 0x01; // P2.0 = output direction
P2SEL |= 0x01; // P2.0 = ACLK function
P1DIR |= 0x02; // P1.1 = output direction

BCSCTL1 |= XTS; // ACLK = LFXT1 = HF XTAL
BCSCTL3 |= LFXT1S1; // 3 ?16MHz crystal or resonator

do
{
IFG1 &= ~OFIFG; // Clear OSCFault flag
for (i = 0xFF; i > 0; i--); // Time for flag to set
}
while (IFG1 & OFIFG); // OSCFault flag still set?

BCSCTL2 |= SELM_3; // MCLK = LFXT1 (safe)

for (;;) // Infinite loop
{
P1OUT |= 0x02; // P1.1 = 1
P1OUT &= ~0x02; // P1.1 = 0
}
}



http://bbs.lierda.com/showthread.php?t=39816
点赞  2009-2-11 13:26
425记得没有XT2,所以得把FLL_CTL0中的XTS_FLL选择高频模式,别的自己再看下用户手册惊醒相应的设置。
点赞  2009-2-11 14:47
是将FLL_CTL0中的XTS_FLL选择高频模式,但是采集OFIFG位始终为高电平(振荡失效)。手册上有OSCOFF=0怎样设置?
点赞  2009-2-11 15:15
另外可以测出P1.5输出8MHz.不知是什么原因?
点赞  2009-2-11 15:17
我也遇到类似的问题,使用的是外部4MHz晶振,经仿真后DCOF始终置位
点赞  2015-1-19 10:33
电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 京公网安备 11010802033920号
    写回复