jtvalley 0 Posted April 6, 2016 Share Posted April 6, 2016 Hi, I am new to MSP432 and Xbee devices. I am trying to use the MSP432 and the Diji Xbee S1 to transmit and receive audio signals. However, I can't seem to transmit data over the Xbee. I just have the xbee module connected to pins: 3.3V, Ground, pin 3.3 transmitter and 3.2 receiver... I have confirmed that the Xbee's communicate using XCTU. Code: void setup() { Serial.begin(9600);// baud rate setting } void loop() { Serial.print("Failing");// send mic value over serial delay(100);// for testing } I can see the "Failing" showing up on the com port but not on the other xbee on the XTCU console screen. Any help would be much appreciated. Quote Link to post Share on other sites
Sterny 12 Posted April 6, 2016 Share Posted April 6, 2016 I've only used the S2 parts, but think the S1 used the AT firmware - if it was a S2, I'd suggest making sure you have the appropriate firmware installed. Are you using the sparkfun explorers to connect to your PC? Can you a use a serial terminal program like putty/screen and get the two chatting by connecting a terminal to comX and another instance to comY, where x and y are the comports of the FTDI on the sparkfun? I'm not clear what you mean when you say you can see failing show up on the comport - do you mean the MSPs com/serial port? I've only played with xbee's on Arduino, but there's a limitation on AVRs with only one hardware UART. You needed to define two pins with software serial to bitbang the connection to the xbee. You then can watch the MCUs serial connection, on say pins 0 and 1, and connect the xbee to software serial pins 2 and 3. The fact that you can see 'Failing' somewhere means to me that you're not serial printing to the xbee - just the USB uart connected to the MSP432. energia 1 Quote Link to post Share on other sites
jtvalley 0 Posted April 6, 2016 Author Share Posted April 6, 2016 I've only used the S2 parts, but think the S1 used the AT firmware - if it was a S2, I'd suggest making sure you have the appropriate firmware installed. Are you using the sparkfun explorers to connect to your PC? Can you a use a serial terminal program like putty/screen and get the two chatting by connecting a terminal to comX and another instance to comY, where x and y are the comports of the FTDI on the sparkfun? I'm not clear what you mean when you say you can see failing show up on the comport - do you mean the MSPs com/serial port? I've only played with xbee's on Arduino, but there's a limitation on AVRs with only one hardware UART. You needed to define two pins with software serial to bitbang the connection to the xbee. You then can watch the MCUs serial connection, on say pins 0 and 1, and connect the xbee to software serial pins 2 and 3. The fact that you can see 'Failing' somewhere means to me that you're not serial printing to the xbee - just the USB uart connected to the MSP432. I can't find any software serial examples for the MSP432, only the MSP430. So I don't know how to define the pins for this program... The two xbee can communicate just not through the energia code. Quote Link to post Share on other sites
jtvalley 0 Posted April 6, 2016 Author Share Posted April 6, 2016 How would I declare the UART pins and then send the data to those pins so it can transmit to the other Xbee Quote Link to post Share on other sites
dubnet 238 Posted April 6, 2016 Share Posted April 6, 2016 You may want to try using Serial1 to output to your module rather than Serial. Serial, as the previous poster alluded to, is the backchannel UART via the USB port. Serial1 is for the hardware port on the Launchpad. energia 1 Quote Link to post Share on other sites
jtvalley 0 Posted April 6, 2016 Author Share Posted April 6, 2016 So the serial1 seems to NOT be sending data via USB port now which is good I think. However, I am still not receiving anything on the second Xbee device. I don't know if I have to set certain pins for the Xbee device? Quote Link to post Share on other sites
dubnet 238 Posted April 6, 2016 Share Posted April 6, 2016 You would use the standard Launchpad serial pins (J1, pins 3 and 4) to connect to your Xbee. Assuming that you have initialized Serial1 with Serial1.begin(9600), you may also want to verify that the Xbee is running at 9600 baud as well with the same settings (8-N-1 for example) as the Launchpad. energia 1 Quote Link to post Share on other sites
BRey 22 Posted April 7, 2016 Share Posted April 7, 2016 For testing UART connected modules I modified the Energia "Examples->04.Communication->MultiSerial" to this bidirectional Serial Passthru program: /* Multple serial test Receives from the main serial port, sends to the others. Receives from serial port 1, sends to the main serial (Serial 0). The circuit: * Any serial device attached to Serial port 1 * Serial monitor open on Serial port 0: created 30 Dec. 2008 by Tom Igoe This example code is in the public domain. */void setup() { // initialize both serial ports: Serial.begin(115200); Serial1.begin(115200);}uint8_t inByte;void loop() { // read from port 1, send to port 0: if (Serial1.available()) { inByte = Serial1.read(); Serial.write(inByte); } if (Serial.available()) { inByte = Serial.read(); Serial1.write(inByte); }} which makes the Launchpad a simple TTL-Serial converter, Serial is the USB port "/dev/ttyACM0" on my Linux box, Serial1 is the hardware pins 3 (RX) & 4(TX) The USB Serial connection on the MSP432 launchpad seems to be limited to 115200 baud max. Also, the launchpad will only output 3.3v and will be damaged by more than that coming in, is that compatible with your module? B Quote Link to post Share on other sites
jtvalley 0 Posted April 8, 2016 Author Share Posted April 8, 2016 For testing UART connected modules I modified the Energia "Examples->04.Communication->MultiSerial" to this bidirectional Serial Passthru program: /* Multple serial test Receives from the main serial port, sends to the others. Receives from serial port 1, sends to the main serial (Serial 0). The circuit: * Any serial device attached to Serial port 1 * Serial monitor open on Serial port 0: created 30 Dec. 2008 by Tom Igoe This example code is in the public domain. */ void setup() { // initialize both serial ports: Serial.begin(115200); Serial1.begin(115200); } uint8_t inByte; void loop() { // read from port 1, send to port 0: if (Serial1.available()) { inByte = Serial1.read(); Serial.write(inByte); } if (Serial.available()) { inByte = Serial.read(); Serial1.write(inByte); } } which makes the Launchpad a simple TTL-Serial converter, Serial is the USB port "/dev/ttyACM0" on my Linux box, Serial1 is the hardware pins 3 (RX) & 4(TX) The USB Serial connection on the MSP432 launchpad seems to be limited to 115200 baud max. Also, the launchpad will only output 3.3v and will be damaged by more than that coming in, is that compatible with your module? B okay I ran this code onto my msp432 with the zigbee connected to the correct pins. How am I suppose to know if the zigbee is communicating? I need it to send information from the msp432 analog in pin to out through pin 4 of msp432 which is the tx of zigbee. Quote Link to post Share on other sites
dubnet 238 Posted April 8, 2016 Share Posted April 8, 2016 Your last sentence made me wonder if you are connecting pin 4 (TX of the MSP432) to the TX of the Zigbee module. The TX of the MSP432 should be connected to the RX of the Zigbee and the TX of the Zigbee to the RX of the MSP432. jtvalley 1 Quote Link to post Share on other sites
jtvalley 0 Posted April 8, 2016 Author Share Posted April 8, 2016 oh my goodness... you are correct, how dumb could I be... I need to sleep once in a while. Thank you so much, I will let everyone know if this solves the issue Quote Link to post Share on other sites
dubnet 238 Posted April 8, 2016 Share Posted April 8, 2016 Not dumb. It would probably be safe to say that everyone on this board has had numerous "That was so obvious....why didn't I see that earlier" moments. Given the complexity of all this it is to be expected. The challenges make it all the more rewarding when your project finally works as expected. jtvalley 1 Quote Link to post Share on other sites
jtvalley 0 Posted April 13, 2016 Author Share Posted April 13, 2016 The xbees are working correctly! I now am having an issue out transferring data to DAC but I will create new forum. Thanks to everyone that helped! I really appreciate it 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.