Jump to content
43oh

MSP430 Serial Bug


Recommended Posts

It appears that there is a bug with Energia, some driver, or my computer. When I try to send anything from the MSP430 to my laptop over the serial port, the data gets corrupted in a systematic way. All bits are duplicated in place and then a zero is appended to the end of the bits. For example, if I send across a 1 (0b1), it becomes 6 (0b110), and if I send across a 2 (0b10), it becomes 24 (0b11000).

 

Below, I have a basic Hello World example that captures the problem pretty clearly. Please let me know if you can replicate the problem and/or have a solution.

 

Processing code:

import processing.serial.*;

void setup() 
{
  println(Serial.list());
  String portName = Serial.list()[8]; // change to your USB port's
  Serial myPort = new Serial(this, portName, 9600);
}

void draw(){}

void serialEvent(Serial myPort) {
  String text = myPort.readString();
  print(text);
}

MSP430/Arduino Code:

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

void loop() {
  Serial.println("Hello World!");
  delay(1000);
}

9gE2mVa.png

 

6VGOJE3.png

Link to post
Share on other sites

https://github.com/energia/Energia/commit/6ea4fee17c54d55cbf75bf80328da6965a5c7ca6 .. this checkin did away with the comment that let people know the msp430g2231 chips max out at 4800

 

https://github.com/energia/Energia/blob/master/hardware/msp430/cores/msp430/TimerSerial.cpp#L108 .. Actual code that forces 4800 max for msp430g2231 chips

 

https://github.com/energia/Energia/pull/78 .. the discussion that tells you why we ended up with this solution

-rick

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...