sendiptangshu 0 Posted June 4, 2018 Share Posted June 4, 2018 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? Quote Link to post Share on other sites
NurseBob 111 Posted June 4, 2018 Share Posted June 4, 2018 > I hope the connection is all right. You might want to think about if you want TX->TX, or TX->RX? energia 1 Quote Link to post Share on other sites
NurseBob 111 Posted June 4, 2018 Share Posted June 4, 2018 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? energia 1 Quote Link to post Share on other sites
energia 484 Posted June 4, 2018 Share Posted June 4, 2018 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. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.