This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430G2755: uart 串口通讯问题

Part Number: MSP430G2755
Other Parts Discussed in Thread: MSP430G2553,

我参考msp430g2553的uart初始化例程(这段程序我已经做过验证是正常的),但在msp430g2755上作了相应的修改,把原通讯接口P1.1,P1.2改成P3.4,P3,5但运行结果却始终不能获得uca0rx的接收数据中断,不知是什么地方没弄对?

//////////串行口初始化
void ini_usart115k()
{
DCOCTL = 0; // Select lowest DCOx and MODx settings
BCSCTL1 = CALBC1_1MHZ; // Set DCO 0x86;//
DCOCTL = CALDCO_1MHZ; // 0xdb;//
P3SEL = BIT4 + BIT5 ; // P1.1 = RXD, P1.2=TXD
P3SEL2 = BIT4 + BIT5;
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 = 8; // 1MHz 115200
UCA0BR1 = 0; // 1MHz 115200
UCA0MCTL = UCBRS2 + UCBRS0; // Modulation UCBRSx = 5
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt
}