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.
我参考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
}
谢谢你的回复,但我的那个g2755的通讯问题一直没有解决,接上超级终端检测一下,发现能够接收字符,但发不出去,检查接线也没错,我以为是msp430g2755硬件坏了,换了一片新的情况还是一样,实在无奈.
您好,我会在您的另一个问题中回复您:https://e2echina.ti.com/support/microcontrollers/msp430/f/msp-low-power-microcontroller-forum/299448/msp430g2755-uart-example
同一个问题请您保持在一个线程中跟进,两个线程间不断切换会很混乱。谢谢!