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.

MSP430G2553: [Launchpad] [Energia] Serial.write doesn't work as expected

Part Number: MSP430G2553
Other Parts Discussed in Thread: ENERGIA

Hi

 I have launchpad with msp430g2553 (MSP-EXP430G2) (rev 1.5)

I tried use Energia IDE to run few small programs, but for some reason Serial.write/Serail.print doesn't work as expected

I use Energia v18 (tried both with v17 and v18), Windows 7 64 bit, USB 3.0, necessary drivers were installed

I configured jumpers (J3) to use hardware uart

Code is something like

void setup() {
Serial.begin(9600);
}

void loop() {
Serial.write(2);
delay(1000);
}

I expect to get 2 (as 0x00000010 in binary) on PC, but I getting 224

Also, it's not always 224, but it may vary from 224 to 225 (so, I send the same number from MSP430, but get different numbers on PC)

Do you have any ideas about possible issue ?
I tried it on 2 laptops (both with usb 30)

  • Hi Maxim,

    What kind of terminal program are you using to interpret the data? Serial.print() sends data to the serial port as human-readable ASCII text whereas Serail.write() sends the simple binary data to the serial port. Most terminal programs default to interpreting incoming data as ASCII text (unless otherwise instructed) so writing a value of 2 to the terminal is equivalent to a "start of text" command on the ASCII table and could result in the nonsensical data referred to. You could use a logic analyzer or oscilloscope to confirm that the data is being sent out of the MSP430 correctly. However it should be noted that according to the MSP Debuggers Guide (SLAU647) the eZ430 is not supported on USB 3.0 ports: e2e.ti.com/.../

    Regards,
    Ryan
  • Hi

    > What kind of terminal program are you using to interpret the data? 

    I tried few - Energia Serial Monitor, putty, Advanced Serial Port Terminal

    Yes, I understand difference between Serial.pring and Serial.write

    Ok, I will try to find computer with USB 2.0 and check the same

    I will update once I do it

    Thank you for answering!

**Attention** This is a public forum