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.

MSP430FR2633: UART Tx Issue

Part Number: MSP430FR2633

Hi,

I am new to the MSP430FR2633 device. In my application I need two UART so I have choose it.

Right now I have a interface XBee with UCA1 port of UARTs pin and working on 9600 Baud.

The data from  XBee to uC on UART receive perfectly. but the data what I wana to send from uC to Xbee is unable to do. Can any one check my code I have a written perfect or not ?

I have also seen on Oscilloscope, in oscilloscope the Tx and Rx data I can see. All Helps are welcome.

int main(void)

{
  WDTCTL = WDTPW | WDTHOLD;                 // Stop watchdog timer

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

   P2SEL0 |= BIT6 | BIT5;                    // set 2-UART pin as second function

   // Configure UART
   UCA1CTLW0 |= UCSWRST;
   UCA1CTLW0 |= UCSSEL__SMCLK;                    // 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 = 0x2000 | UCOS16 | UCBRF_8;

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

   //__bis_SR_register(GIE);         // Enter LPM3, interrupts enabled


   while(1)
   {


	   __bis_SR_register(LPM0_bits | GIE);         // Enter LPM3, interrupts enable

   }

 }
#pragma vector=USCI_A1_VECTOR
__interrupt void USCI_A1_ISR(void)
{
  switch(__even_in_range(UCA1IV,USCI_UART_UCTXCPTIFG))
  {
    case USCI_NONE: break;
    case USCI_UART_UCRXIFG:
     {
      uart_received_frame();
     }
     //UCA0IE &= ~UCTXIE;
     break;
    case USCI_UART_UCTXIFG:
    {
      Trasnmit_Frame();

    }
    UCA1IE |= UCRXIE;
     break;
    case USCI_UART_UCSTTIFG: break;
    case USCI_UART_UCTXCPTIFG: break;
    default: break;
  }
}


void Trasnmit_Frame()
{
 UCA1TXBUF = Send_Data[Pointer++];
   if(Pointer > 18)
     {
       UCA1IE &= ~UCTXIE;
        Pointer = 0;
        Reading = 0;
        Checksum = 0;

       }
}

  • Hi,

    First, to clarify, you are saying that you can see the correct transmitted data on the oscillosope? IF this is the case, then the issue is with the Xbee because the MSP430 would be correctly transmitting the data. However, looking at your code, I do not see anywhere where you enable tx interrupts. If this is the case, then you will never get to the case in the ISR, and Transmit_Frame will never be called, so no data will be sent.

    Regards,
    Nathan
  • Hi Nathan,

    Yes, I can see correct data on oscilloscope.
    After enabling transmitting interrupt in the code, Program Counter goes to ISR and sucessfully exexute it. But at the end I'm not getting data on Xbee.
  • Hi,

    I am glad that enabling tx interrupts is allowing your ISR to be reached correctly. Since the MSP is sending the correct data on the tx line, the issue is with the Xbee not receiving it for whatever reason. You will need to debug your program on that device.

    Regards,
    Nathan

**Attention** This is a public forum