Jump to content
sendiptangshu

SoftwareSerial Communication Issues

Recommended Posts

 

I am trying to establish SoftwareSerial Communication between 2 msp430g2553 units. I have connected them as follows: GND to GND, RX to TX and vice versa.

MSP1: P1_5, P1_7 //Rx,Tx

MSP2: P1_5, P1_7//Rx, Tx , I hope the connection is all right.

Now, I want to send a byte from one mcu to the other for which I write the following code:

Send function:

void sendrequest(){
    byte option = 1;
    mySerial.write(option);
   delay(2);
  return;
}
void loop()
{
  // put your main code here, to run repeatedly:
if(mySerial.available()>0){  
checkiffalsesignal();
delay(10000);
}
}

void checkiffalsesignal(){
  byte a = mySerial.read();
  if(a==1)Serial.println("Low Budget");
  else if(a==2)Serial.println("High Budget");
  else Serial.println("False Signal");
  delay(2);
  return;
}

The second one is the receive function. But, I either receive nothing on the serial monitor or sometimes, I receive a "False Signal" message. Where is the fault?

Share this post


Link to post
Share on other sites

Also, where is sendrequest() ever callled?  Who's sending, who's responding? Unclear from your code snippet(s)  if anyone is sending, if one is sending, etc.  Are both running the same code?

Share this post


Link to post
Share on other sites

With the example Sketch "SoftwareSerialExample" loaded on both MSP2553's it works correctly when connecting them P1_4<->P1_3 and P1_3<->P1_4.

Make sure that you set the baudrate to 9600. The 2553 can not handle faster baudrate's for Software Serial.

Also after programming them and wiring them up, reset both of them using the reset button.

Share this post


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...