2 xiaoan19921107 xiaoan19921107 于 2013.06.02 00:14 提问

430F5438A的UART3串行通信程序一直跑不通,不知哪里出问题了,菜鸟求救

#include "MSP430F5438A.h"
void init_clock(void);
void init_uart3(void);

void main(void)
{
WDTCTL = WDTPW + WDTHOLD;

init_clock();
init_uart3();
__bis_SR_register(LPM0_bits + GIE); //enter LPM0,interrupt enabled
__no_operation();
}

void init_clock(void)
{
unsigned int i;
WDTCTL = WDTPW + WDTHOLD;
P11DIR = BIT0 + BIT2 + BIT4;
P11SEL |=BIT0 + BIT2 + BIT4;
P5SEL |=0x0C;//director:选择外部时钟(port select XT2)
UCSCTL6 &=~ XT2OFF; //director:enable XT2 if not used
UCSCTL3 |= SELREF_2; //director:FLLref = REFO
UCSCTL4 |= SELA__XT2CLK;//director:ACLK from XT2 4M
UCSCTL4 |= SELS_5 + SELM_5;//director:SMCLK=MCLK=XT2=4M
_NOP();
UCSCTL5 = DIVM_2 + DIVS_4 + DIVA_4;//director:XT2-4M,SMCLK-1M,ACLK-1M;
do
{
UCSCTL7 &=~ (XT2OFFG + XT1LFOFFG + DCOFFG);//clear XT2,XT1,DCO fault flags
SFRIFG1 &=~ OFIFG;//director:Clear fault flags
for(i=0;i<0xFFFF;i++);//director:wait for Osc to stabilize

}while(SFRIFG1&OFIFG);//director:test Osc fault flag
}

1个回答

lyyybz
lyyybz   Rxr 2016.08.19 10:54

请问你的问题解决了么,我碰到和你一样的问题!

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!