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.