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:MSP430

Guru**** 2526830 points
Other Parts Discussed in Thread: MSP430G2553

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/868714/compiler-msp430g2553-msp430

器件型号:MSP430G2553

工具/软件:TI C/C++编译器

您好、先生、

在此代码中、我无法禁用接收引脚、从而使数据能够无限打印。 您能不能帮助我在传输过程中仅获取一次输出。

#include "msp430g2553.h"

//#define TXLED BIT0
//#define RXLED BIT6
#define TXD BIT2
#define RXD BIT1

unsigned int i;
int main (空)

WDTCTL = WDTPW + WDTHOLD;//停止 WDT
DCOCTL = 0;//选择最低 DCOx 和 MODx 设置
BCSCTL1 = CALBC1_1MHz;//设置 DCO
DCOCTL = CALDCO_1MHz;
P2DIR |= 0xFF;//所有 P2.x 输出
P2OUT &= 0x00;//所有 P2.x 复位
P1SEL |= RXD + TXD;// P1.1 = RXD、P1.2=TXD
P1SEL2 |= RXD + TXD;// P1.1 = RXD、P1.2=TXD
// P1DIR |= RXLED + TXLED;
P1OUT &= 0x00;
UCA0CTL1 |= UCSSEL_2;// SMCLK
UCA0BR0 = 0x08;// 1MHz 115200
UCA0BR1 = 0x00;// 1MHz 115200
UCA0MCTL = UCBRS2 + UCBRS0;//调制 UCBRSx = 5
UCA0CTL1 &=~UCSWRST;//**初始化 USCI 状态机**
P1DIR|=BIT6 + BIT0;
//P1OUT |= BIT6;

UC0IE |= UCA0RXIE;
UC0IE |= UCA0TXIE;//启用 USCI_A0 RX 中断
//_bis_SR_register (CPUOFF + GIE);//输入 LPM0、带 int 直到字节 RXed
_enable_interrupt ();
while (1)

P1OUT |= BIT6;


#pragma vector=USCIAB0TX_vector
_interrupt void USCI0TX_ISR (void)

UCA0TXBUF = UCA0TXBUF + 1;

UC0IE &=~UCA0RXIE;

//P1OUT |= BIT0;