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.
工具与软件:
您好、TI 团队:
每当 UART RX 从键盘接收到"t"时、我将使用 TI MSP430FR5969微控制器使 LED P4.6闪烁。 我把我的代码复制到这段文字中、问题是当我按下"没有发生任何情况"时会出现这种情况。 我敢肯定该代码是正确的、而且 MSP430完全是新的。 是否有人仍能审阅代码或提供解决此问题的方法?
代码
#include
/**
* main.c
*/
int main (void)
{
WDTCTL = WDTPW | WDTHOLD;//停止看门狗计时器
UCA0CTLW0 |= UCSWRST;
UCA0CTLW0 |= UCSSEL__SMCLK;
UCA0BRW = 8;
UCA0MCTLW = 0XD600;
//设置端口
P2SEL0 &=~μ s BIT1;
P2SEL1 |=位1;
P4DIR |=位6;
P4OUT &=~BIT6;
PM5CTL0 &=~μ H LOCKLPM5;
UCA0CTLW0 &=~μ s UCSWRST;
UCA1IE |= UCRXIE;
___ enable_interrupt ();
while (1){
}
返回0;
}
#pragma vector = USCI_A0_VECTOR
_interrupt void RX_vector (void)
{
如果(UCA0RXBUF ="t")
{
P4OUT ^= BIT6;
}
}
谢谢!
此致、
Pukhraj Singh
UCA0RXBUF 不是字符串、它是一个字符。
请尝试
if (UCA0RXBUF ="t")//单引号
我刚刚在 MSP-EXP430FR2311上进行了尝试、结果得到的警告非常清楚。
谢谢基思,不知道为什么我不认识它!!