do
{
IFG1 &= ~OFIFG; // Clear OSCFault flag
for (i = 0xFF; i > 0; i--); // Time for flag to set
}
while ((IFG1 & OFIFG) != 0); // OSCFault flag still set?
BCSCTL2|=(SELM1+SELS); //MCLK=XT2CLK SMCLK=XT2CLK
UCTL0 = CHAR; // 8-bit character
UTCTL0 =SSEL1+SSEL0; //UCLK=SMCLK;
//BCSCTL2 |= SELM1; // MCLK = XT2 (safe)
//UCTL0 &=~ SWRST; // reset SWRST bit
//UTCTL0 = SSEL0; // UCLK = ACLK
UCTL0 = 0x10; //8 data bits, even parity, 1 stop bit
UBR00 = 0x41;
UBR01= 0x3;
//UBR10 = 0x00;
UMCTL0 = 0x03; //BDR=9600 ,8 M jingzhen