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.

MSP430FR6972串口UCA0串口问题

Other Parts Discussed in Thread: MSP430FR6972

msp430fr6972的uca0串口 ,用引脚P2.0,P2.1时正常,发送接收都没问题,但是使用P4.2,P4.3时,只能发送数据,无法接收数据,确认已经通过usb转串口发送数据出去了,但是单片机无法进入中断。中断函数为同一函数,只是使用的引脚不一样,不知道问题在哪里。

  • 请问您是用的TI的开发板还是自己设计的板子?
    使用P4.2,P4.3时具体引脚是怎么配置的呢?
  • 自己画的板子,串口配置如下
    // Configure GPIO
    P4SEL0 |= BIT2 | BIT3; // USCI_A0 UART operation
    P4SEL1 &= ~(BIT2 | BIT3);

    // Configure USCI_A0 for UART mode
    UCA0CTLW0 = UCSWRST; // Put eUSCI in reset
    UCA0CTLW0 |= UCSSEL__SMCLK; // CLK = SMCLK

    UCA0BR0 = 104; // 16000000/9600/8
    UCA0BR1 = 0;
    UCA0MCTLW |= UCOS16 | UCBRF_2 | 0xD600;
    UCA0CTLW0 &= ~UCSWRST; // Initialize eUSCI
    UCA0IE |= UCRXIE; // Enable USCI_A0 RX interrupt