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.

MSP430FR2475: UART Not Functioning

Part Number: MSP430FR2475

Dear Sir,

I am using own board design for msp430fr2475. Board is work well. now i am trying to uart code for your example code from ti resource explorer. 

debug the code, It's check all uart registers is working well and TXBUF also stored correct value. but tx bin is not send a data (I will check oscilloscope and PC). here attached my example code . Kindly reply me.

I am using  32-Pin RHB Package IC (MSP430FR2475)

My hardware connection is,

P2.5 - RXD

P2.6 - TXD

#include <msp430.h>

void Init_GPIO();

int main(void)
{
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer

// Configure GPIO
// Init_GPIO();

PM5CTL0 &= ~LOCKLPM5; // Disable the GPIO power-on default high-impedance mode
// to activate 1previously configured port settings

// Configure UART pins
SYSCFG3|=USCIA0RMP; //Set the remapping source
P2SEL0 |= BIT5 | BIT6; // set 2-UART pin as second function

// Configure UART
UCA1CTLW0 |= UCSWRST;
UCA1CTLW0 |= UCSSEL_1; // set ACLK as BRCLK

// Baud Rate calculation. Referred to UG 17.3.10
// (1) N=32768/4800=6.827
// (2) OS16=0, UCBRx=INT(N)=6
// (4) Fractional portion = 0.827. Refered to UG Table 17-4, UCBRSx=0xEE.
UCA1BR0 = 6; // INT(32768/4800)
UCA1BR1 = 0x00;
UCA1MCTLW = 0xEE00;

UCA1CTLW0 &= ~UCSWRST; // Initialize eUSCI
UCA1IE |= UCRXIE; // Enable USCI_A0 RX interrupt

__bis_SR_register(LPM3_bits|GIE); // Enter LPM3, interrupts enabled
__no_operation(); // For debugger
}

#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=USCI_A0_VECTOR
__interrupt void USCI_A0_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(USCI_A0_VECTOR))) USCI_A0_ISR (void)
#else
#error Compiler not supported!
#endif
{
switch(__even_in_range(UCA0IV,USCI_UART_UCTXCPTIFG))
{
case USCI_NONE: break;
case USCI_UART_UCRXIFG:
while(!(UCA0IFG&UCTXIFG));
UCA0TXBUF = UCA0RXBUF;
__no_operation();
break;
case USCI_UART_UCTXIFG: break;
case USCI_UART_UCSTTIFG: break;
case USCI_UART_UCTXCPTIFG: break;
default: break;
}
}

Thank you!

  • Per data sheet (SLASEO7B) Table 6-24, P2.5/6 are UCA1, but your ISR works with UCA0. So in

    >#pragma vector=USCI_A0_VECTOR
    >switch(__even_in_range(UCA0IV,USCI_UART_UCTXCPTIFG))
    >while(!(UCA0IFG&UCTXIFG));
    >UCA0TXBUF = UCA0RXBUF;

    These should all refer to A1, not A0

**Attention** This is a public forum