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.

Data sent through UART of MSP430F5508 gets corrupted after 128 bytes are sent at 9600 baud. How can it be rectified?

Prodigy 200 points

Replies: 23

Views: 2189

I am programming a MSP430F5508 chip and using it for Timer interrupts and then finally sending the processed data in an Array of 130 bytes through the UART.

The first 128 bytes are acccurately transmitted but the two bytes after are corrupted. They can be read properly in IAR when I debug the chip through it. However the transmission is failing. Is it an overrun error? What is it? How to rectify it?

23 Replies

  • In reply to Hardik Katyarmal:

    int and short int? These should be the same size on a 16 bit system.


  • In reply to Dennis Eichmann:

    When sending the bytes from this loop

    while( i < dataXmitLength )      //dataXmitLength is 128, i initialised to 0
    {
      while( !(UCA1IFG & UCTXIFG) ); // USCI_A0 TX buffer ready?
      UCA1TXBUF = DataArray[i++];
    }

    is the RX interrupt disabled?


  • In reply to Dennis Eichmann:

    Yes. RX Interrupt is disabled
  • In reply to Hardik Katyarmal:

    There are a few remarks regarding your baudrate - it says 9600 and 19200. Which baudrate are you using? And what is your SMCLK and where does it come from? Is it a precise clock source? You can route SMCLK to an output pin to measure it externally.


  • In reply to Dennis Eichmann:

    The baud we are using is 9600. Yes we are using an SMCLK 1 MHZ
  • In reply to Hardik Katyarmal:

    Then your MCTL-setting is wrong. It should be:

    UCA1MCTL = 0x2000 | UCBRF_8 | UCOS16;


  • In reply to Dennis Eichmann:

    That didnt make much of a difference!
    It still adds up those two extra bytes.
  • In reply to Hardik Katyarmal:

    I also put a watch on the UCA1TXBUF and the last data it sent does not include those two extra bytes. It still shows the last data sent!
  • In reply to Hardik Katyarmal:

    Looking at the UCA1TXBUF watch, it seems like the Chip is sending the data just fine!
    What else could be a problem?
  • In reply to Hardik Katyarmal:

    Are the additional sent data bytes always the same or do they change?


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.