Part Number: MSP430FR2476
hi
IC:MSP430FR2476TRHB
UART0:P1.4--TXD0,P1.5--RXD0
UART 0 can enter the receive interrupt, and the data in UCA0RXBUF is correct. Single-step debugging, can enter the transmit interrupt, and the data in UCA0TXBUF is correct, but the host computer software can not receive data. Oscilloscope test TXD0 port, no signal output.
Add SYSCFG3|=USCIA0RMP; the fault remains.
The host computer software and serial line have been ruled out no problem, the hardware connection is also no problem. Tried several boards are the same fault!
The configuration of URAT1 is the same as that of UART0, and the serial port sends and receives data normally.
//IO
P1DIR |= 0xff; // Set unuse pins to output direction
P1SEL0 |= BIT2+BIT4+BIT5; // P1.4-P1.5 UART
// Setup USCI_A0 9600 n 8 1
UCA0CTLW0 |= UCSWRST; // **Put state machine in reset**
UCA0CTLW0 |= UCSSEL_2; // SMCLK
// UCA0BR0 = 26;
// UCA0BR1 = 0;
// UCA0MCTLW = 0xB600 | UCOS16 | UCBRF_1;
UCA0BR0 = 52; // 8MHz 9600 (see User's Guide)
UCA0BR1 = 0; // 8MHz 9600
UCA0MCTLW = 0x4900 | UCOS16 | UCBRF_1;
UCA0CTLW0 &= ~UCSWRST; // **Initialize USCI state machine**
UCA0IE |= UCRXIE; // Enable USCI_A1 RX interrupt
#pragma vector=USCI_A0_VECTOR
__interrupt void USCI_A0_ISR(void)
{
switch (__even_in_range(UCA0IV, 4))
{
case 0: break; // No interrupt
case 2: // RXIFG
{
RX232_BUFF0[RX232_IndexW0]=UCA0RXBUF;//FIFO
// while ((UCA1IFG&UCRXIFG));
RX232_IndexW0++;
if(( RX232_BUFF0[RX232_IndexW0-2] == 0x0D)&&( RX232_BUFF0[RX232_IndexW0-1] == 0x0A))
{
RX232_IndexW0=0;
REC232_FLAG0=1;
}
if(RX232_IndexW0 >=RX232BUF_SIZE0)
{
RX232_IndexW0=0;
}
break;
}
case 4: // TXIFG
{
if(TX232_OutLen0>0) //FIFO
{
TX232_OutLen0--;
UCA0TXBUF=TX232_BUFF0[TX232_IndexR0];
while (!(UCA0IFG&UCTXIFG));
if(++TX232_IndexR0 >= TX232BUF_SIZE0)
{
TX232_IndexR0=0;
}
}
else
{
UCA0IE &= ~UCTXIE;
}
break;
}
default: break;
}