The communication between the xbee and MCU.

Hi all, I have a Digimesh 2.4 radio module. I am trying to send the command from my MCU to my Xbee through serial port. I think this should use API operation. The practice I have done so far is to use AT command operation to do the peer-to-peer communication and broadcast. This helps me to be familiar with these commands.

Dev board:DEMOQE128

Attachments are my equipment and scenario.

My question is:

  1. How can I enter API operation since I already
    use xbee to be connected to my MCU, the X-CTU cannot
    detect the radio module this time.
  2. What is the first step I should do for the
    communication from MCU to Xbee? I am going to send
    the commands to my Xbee from MCU.
  3. Should I use the Code Warrior as my compiler due to
    this is the compiler specified for my MCU?

Any answer will be appreciated.

If you are unable to connect the radio to an interface board so you can modify the radios settings, then I would recommend one of the following options:

  • Modify your existing code in your mC to send the ATAP command to enable API mode.
  • If this is not an option, then I would recommend using a 3rd radio in API mode to send a remote AT command setting the parameter.

If your mC code was written Code warrior, then you will most likely need to use this same software to modify the code on your mC to send the ATAP command.


Thanks for the reply. Your experience is very important to me.

What I am trying now is to send the command from my MCU to Xbee.

Below are my questions:

I have set up the xbee baud rate(115200) which matches the baud rate with my MCU. If I wanna send the commands, for example, “ATVR”, I should enter the AT command mode. So do I need to send the “+++(in order to enter the AT command mode)” first then send “ATVR” to my xbee?

If the first step is correct, I should get the data about the firmware version about the Xbee. I do not need to display the data on my terminal since this is just a test to ensure that my MCU can talk to my xbee. I saw that 4LEDs on my Xbee dev board. Can you teach me how can I set up tge LED to get the indication for my data?
(For example, if my xbee gets the command, then LED1 blink. If my xbee get the command(ATND)(LED1 blink) and brocast the command,then LED2 blink)

Above is my quesiton and thanks for your time.


Hi Musshel,

Thanks for the reply.

So you mean I can write the code in my MCU to send the command(ATAP 1or2) to my Xbee to enable API mode, Am I correct?

Can you give me any hint about the communication of MCU to Xbee? How can I send the command from MCU to Xbee through serial port? Any sample code I can read eventhrough MUCs are different sorts. Thanks.

I don’t have any sample code I can provide you. However, the product manual has examples of how to modify the radio settings. All you should need to do is to write your code so that you open the COM port at the proper baud rate and then send the commands with the proper timing. Except for the timing, the process will be the same as if you where going to send data out a UART.