I am trying to get the SoftwareSerial library to work on my MSP430G2 (using M30G2553) but with limited success.
First I tried attaching my trusty RF device but got no communication either end. To resolve I started troubleshooting and was a little surprise by results.
First I hooked up an Arduino Mega to the MSP430G2 through Arduino Mega Serial 1 RX/TX which talked to MSP430G2 pins P1_4, P1_3 through SoftwareSerial. I included a loop command in both Arduino code and MSP430 code.
Arduino: set up with 9600 baud
unsigned int i = 0;
void loop() // run over and over
{
if (Serial1.available())
Serial.write(Serial1.read());
if (Serial.available())
Serial1.write(Serial.read());
if (i>50000) {
Serial1.println("Hello, Launchpad?");
i = 0;
}
i++;
}
MSP430G2: set up with 9600
unsigned int i = 0;
void loop() // run over and over
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
if (i>50000) {
mySerial.println("Hello, Arduino?");
i = 0;
}
i++;
}
I received communication between the two no problem. Arduino received message cleanly everytime but with MSP430 it received the message but regularly and periodically it also seemed to receive some garbage bytes through its RX line.
I then attached the RX and TX lines to pins 3 & 4 on Arduino Mega also using the SoftwareSerial library. This time I received no communication at all between the two MCU's suggesting a timing issue (even though baud rate is slow enough at 9600).
I then detached the Arduino altogether and just monitored MSP430 through serial monitor. I was surprised by what I saw. I merely touched/wobbled the wires and garbage bytes started to appear through its RX line. I then detached the wires altogether from MSP430. Of course nothing but as soon as I touched the pins garbage started appearing.
How does one resolve this noise.