10 years, 9 months ago.

FRDM + xbee connection

Hi guys, i am totally new to this. I have just received my FRDM KL25Z board and i have attached an xbee series 2 on the PINs PTD3 (tx) PTD2(rx). I have configured my xbee as an Coordinator API. I have tried many different codes. However i haven't managed to speak to my xbee and receive a confirmation to my PC terminal port (Tera-Term) saying: "Data have been received ok". Could anyone help?

3 Answers

10 years, 9 months ago.

Hi Filippos,

Your code will work (I just ran your code), provided (as Erik states) your XBee modules are configured to run in transparent (e.g. AT) mode.

With the XBee's in API mode you must send them properly formatted API communication frames. Check page 98 of the Digi XBee Hardware Reference Manual (http://ftp1.digi.com/support/documentation/90000976_P.pdf) for more detailed information.

Regards, Cameron

Accepted Answer

Hi Cameron, Thanx for your help i just made it to get some analog input between 2 xbees and Frdm board too. Regards, Phil

posted by Filippos Tragas 30 Jul 2013
10 years, 9 months ago.

I have written this code by the way. I don't know why it doesn' work:

  1. include "mbed.h"

Serial pc(USBTX, USBRX); tx, rx Serial xbee(PTD3, PTD2); tx, rx DigitalOut myled(LED1); int main() { char mychar; pc.printf("type anything you want to transmit to the local radio\n"); while (1) { if (pc.readable()) { mychar=pc.getc(); xbee.putc(mychar); } if (xbee.readable()) { mychar=xbee.getc(); pc.putc(mychar); myled = 1; } } }

10 years, 9 months ago.

Put code between <<code>> and <</code>>

I haven't used xbee myself, but how are you testing them? If they are just operating in transparant mode I dont see why you would get a confirmation "Data have been received ok".

I ve run the code,thanx Eric

posted by Filippos Tragas 31 Jul 2013