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.

MSP430 UART keeps sending hex FF

Other Parts Discussed in Thread: MSP430F5529, ENERGIA

Hi forum members,

 I ran into this problem using UART on both board MSP-EXP430G2 (2553) and MSP430F5529

Here is the sketch to check out the UART, modified from an example on Energia website.

The sketch just check to see if any byte is available, then print it out.

If I entered "1", it sent back "31" . This works fine.

However when nothing was entered, it send back FFFFFFFF non stop (that was why I added the delay (1000) to slow it down)

This was when I used the Flush() command to clear any unwanted data. Problem is still there.

First I thought maybe something wrong with MSP board. So I loaded the same sketch to MSP430F5529 and got exact same thing.

What did I do wrong ?  Thanks for your help.

*****   Sketch     ********************************************************************************************************************************************

int incomingbyte = 0; 

void setup()

{

Serial.begin(9600); 

Serial.println("MSP430");

}


void loop()
{


Serial.flush(); // This statement was added later to clear the buffer. But it did not help.


if (Serial.available() > 0);
{
incomingbyte = Serial.read();
Serial.print(" receive: ");
Serial.println(incomingbyte, HEX);
}

delay(1000);
}

**********************************************************************************************************************************************************************

Here is the result on Serial Monitor window

MSP430                                 From Setup()
receive: FFFFFFFF
receive: FFFFFFFF
receive: FFFFFFFF
receive: FFFFFFFF
receive: FFFFFFFF
receive: 31                         After I entered 1
receive: FFFFFFFF
receive: FFFFFFFF
receive: 32                          After I entered 2
receive: FFFFFFFF
receive: FFFFFFFF
receive: FFFFFFFF
receive: 33                       After I entered 3
receive: FFFFFFFF

****************************************************************************************************************************************************************

BTY, because the sketch above keeps transmitting FF back, some how it causes this error when I try to upload another sketch. Here is the error.

tilib: MSP430_Initialize: Could not find MSP-FET430UIF on specified COM port (error = 57)
tilib: device initialization failed

The way I fixed this was to remove both Rx and Tx jumper. Load new sketch and put jumpers back on.

  • I have no idea what Energia does. It sounds like you don't know precisely what needs to make it do what you want either. I usually try to keep things simple and stupid and do the fundamental basic operations that both the hardware and I know.

    Energia may be very fancy and smart, but it still cannot figure out what you were thinking. It look great when someone shows you a demo.

    "I just say this, and everything is automatically done the way it should. See how powerful and useful it is?"
  • Found the cause. Silly me.

    if (Serial.available() > 0); <-------------- the ; should not be there.

    However, the problem of Error = 57 is still there. My guess is that as long as UART is being used, it interferes with the uploading process.

    As for now I leave this secondary problem open for everyone to see.

    Thanks again.

**Attention** This is a public forum