m3pi and XBee

Hi,

though i read the m3pi user manual i am not sure if i have to set any jumpers if i want to use a Xbee module with the LPC1768. Are teh serial port pins connected? Do i need any additional level shifting because of VCC = 5Volts?

Thanks in advance,

MuckiSG

Hello.

The relevant section of the user’s guide is the section titled “mbed and Wireless Module Sockets”. Yes, the serial port pins are connected by default. You should not make any connections with the shorting blocks (jumpers). XBee VCC is supplied from mbed VOUT which is 3.3V, and the mbed operates at 3.3V, so there shouldn’t be any voltage-level incompatibility. These pictures from the user’s guide should help:




- Ryan

Hi Ryan,

thanks for your quick response. Becasue of the users’s guide i was not sure about it, maybe it was a language problem. :wink:

Kind regards,

MuckiSG

Hi,

now i have a different problem. Two XBee modules are configured and work fine controlled via X-CTU. They are configured for direct connect, so there is no overhead for a controller and so on. One module is on the m3pi, the other one via sparkfun usb helper board on a laptop. With the follwing code i’d like to sent a string to the pc:

#include "mbed.h"
#include "m3pi.h"

m3pi m3pi;
Serial device(p28, p27);  // tx, rx
DigitalOut led1(LED1);

int main() 
{
    m3pi.cls();
    m3pi.locate(0,0);
    m3pi.printf("Hello...\n");
    device.baud(115200);
    while (1) {
        led1 = 1;
        if (device.writeable()) 
        {  
            device.printf("Hello World\n");
            led1 = 0;
            wait(2.0);
        }
       } 
}

What should i say, it does not work. Is there a simple error which i am unable to see? Ah, yes, both modules have the same configuration 115200 baud, 8,n,1 … :wink:

Thanks very much for help,

Maurice

How does it not work? Does Hello… appear on the 3pi LCD screen? Does the mbed led blink? Can you try simplifying your program by removing the if (device.writeable) condition?

- Ryan

Hi,

the led and display part works. I tried it without the device control but with i i ws sure that it is writeable. On laptop side i would expect “Hello world” in the terminal window. Connection from laptop to laptop side xbee is ok, +++ gives a feedback.

any idea?

Maurice

It sounds like your code is probably correct then. Just to confirm, you have none of the jumpers installed, right? Do you have access to an oscillocope so you can look at the serial line signals to make sure they look good and are getting to the XBee? Also, have you confirmed that your XBees can communicate by doing a loopback test with them independent of the m3pi?

- Ryan

Hi Ryan,

At first thanks for your quick replies. Yes i am at hone now and can check the hardware. I asked because the mbed stuff is quite new to me and i thought i would make a fundamental error. If i find the error i going to post it.

best wishes from Germany,

MuckiSG

Hi again,

just as an update. I checked at the mbed module and at the XBee module via BusPirate in UART mode and i got what i expected, so the sending part is ok, means hardware and software. The receiving parts works if i use X-CTU to X-CTU in range test (loopback) and in terminalmode sending messages from both sides. By the way, each XBee module on a different computer.

But connecting the XBee module to the m3pi sending the “Hello World” message, i am not able to receive it on the other side with a terminal.

I have no idea in the moment. If anyone has an idea …

Thanks and best wiches,

MuckiSG

Can you explain more what you mean by “X-CTU to X-CTU in range test (loopback)”? I suspect the part that is not working is the connection between the XBees.

- Ryan

Hi Ryan,

sorry, X-CTU is the configuration and testing application from Digi for the XBee products. So i connected one XBee module to my laptopn, the other one to my workstation and started X-CTU on both machines. Then you can start an automatic test and/or use the X-CTU internal terminal programm to send messages and AT commands. So the communication works fine. That’s the problem for me to understand.

The firmware is the same on both modules and the settings are ok, i checked them a lot of times and i ptressed my pannic buttom three times by now. :wink:

I will set both modules to facory settings and configure them again which is my last try. But this is for tomorrow, i go to bed now.

Thx, i keep you updated.

MuckiSG

Hi again,

till now no progress but the problem is not within the combonation of m3pi and LPC1768 like the BusPirate analysis shows. So i have to find a different idea …

Thanks for your help, the quick support shows that it was a good idea to buy a m3pi!

MuckiSG

It really sounds like an XBee configuration problem. Instead of having a computer on both sides, I suggest you configure your XBees like you want them. Take the one that would be connected to the m3pi off the m3pi and independently power it. Connect a wire between its TX and RX lines. This would be a loopback test using the settings you think are good.

- Ryan