XBEE-PRO ZB Programmable Getting Started

To get started with XBEE-PRO Programmable after ordering the development kit, download “GettingStarted.zip”.

This file contains the Bootloader, some Shared files between the Bootloader and Application, and a sample Appplication (AppTransparent).

Copyright (C) 2010 Digi International, All Rights Reserved.

This software is provided as instructional material without charge by Digi International for use by its employees and customers subject to the following terms.

PERMISSION
Permission is hereby granted, free of charge, to any person obtaining a copy of this software, to deal with it without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of it, and to permit persons to whom it is furnished to do so, provided the above copyright notice and this permission notice are included in all derived works and the use of this software is restricted to Digi products.

WARRANTY
THIS SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT.

LIABILITY
IN NO EVENT SHALL DIGI INTERNATIONAL BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE, OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.

Debugging the Application:

  1. First the Debuggable booltoader must be loaded through the programmer onto the XBEE
  2. Make the bin file for the Application (Click the Make button)
  3. Upload the Application.Bin file through XCTU XMODEM
  4. Press the Debug button in CodeWarrior. (the button with a play arrow and a bug)
  5. When the debugger screen appears, click “Hotsync” (See attachment)
  6. Click Stop or Reset, Set your break points and you are ready to go

Breakpoints

Breakpoints are lost after a hardware reset/watchdog reset/power cycle.
After one of these the code must be stopped before the resets are loaded again.

Setting a breakpoint in a different section of code (See attachment)

  1. If the menu “Source” is not visible, click in the Source Window to change the focus.
  2. Click the menu “Source”
  3. Click “Open Source File”
  4. Select the Source file from the pop up.
  5. Click OK.
  6. Scroll to the desired line for the breakpoint
  7. Right Click the line for the breakpoint
  8. Select “Set Breakpoint”

Run the code and it should stop when it reaches that breakpoint.
Breakpoints are never set while the code is running.
If the code is running while a new breakpoint was added.
Click the Stop button, then the Run button to add the new breakpoint.

After you ‘Make’ MC9S08_BL32_Debug in CodeWarrior, where does the Application.Bin file appear? I see the bin folder that was created, but I don’t see a .bin file. Which file are you supposed to send via XModem?

Could you explain how this bootloader is different than the Ember Bootloader mentioned in the XBee ZB Product Manual?

Also, how does this bootloader program the separate embedded S08 microcontroller? All I want to do is program the separate mircocontroller to send something from end node XBee to the router XBee in a ZigBee mesh network (such as wirelessly turning on an LED).

Any explanation of what the GettingStarted.zip package is or any documentation on how to program the S08 microcontroller would be very helpful. Thanks for any help.

The Programmable module has a secondary processor. This secondary processor can be programmed without risk to messing up the Radio Certifications of the rest of the circuitry (Ember). Since there are 2 different processors running, there can be 2 separate bootloaders. One for the Ember, in order to upgrade the Radio’s functionality. The other is for the custom code uploaded by you on the MC9S08. A bootloader is not required for the MC9S08, but it does allow the ability to upgrade the code Over the Air or through the Local UART.

There is no bin file created with the bootloader since it can only be loaded by the programmer. The Play/Debug button should be clicked. This will use the 6 pin programmer, connected to the development board, to program the processor with the debuggable bootloader. The only reason for uploading the debuggable bootloader is so debugging can occur during development. The XBEE-PRO S2B Programmable is loaded with the non-debuggable bootloader, which works the same, except it cannot be debugged.

The Application does produce a bin file. This is located in a different folder AppTransparent\XbeeProZBProgrammable\App32Transparent.mcp After a Make is executed the bin file is placed in the Bin folder. The bin file from this app can be uploaded through the bootloader using an XMODEM file transfer. Code changes should be made to the APP not the bootloader.

Unless you want to change the functionality of the bootloader. Like make the baud rate 115200 baud instead of 9600 baud. In main.c change “SCI1BD = UART_BAUD_9600;” to “SCI1BD = UART_BAUD_115200;”. In which case also change the Version String in CmdProcessor.c so that it can be distinguished from the other bootloader. like VERSION[] = “BL032-2B0-D25_064[MYCOMPANY]”

Thanks for the response!

I have a few follow-up questions:

  1. Should the XBee PRO 2SB programmable look exactly the same as a Series 2 XBee PRO? Or, should it say “Series 2SB” underneath the XBee Pro instead of “Series 2”? I am asking because when I press the Play/Debug button and the PEMICRO Connection Manager pops up, it cannot detect the XBee even though it is attached and I can “Test/Query” it fine in XCTU. I don’t know if this could be due to the fact that I am running CodeWarrior in XP through VMWare Fusion on a Mac, but I haven’'t had problems connecting before.
  2. Is the bin file titled: “App32T.abs”?
  3. What is the difference between “App32Transparent.mcp” and “App16Transparent.mcp”? What is this program supposed to do? The description in main.c makes it seem like it does almost exactly the same thing as the XBee can normally do (except for the Special Menu.
  4. Just to understand, the only reason I would want to change the bootloader code would be to make the application upload speed faster/slower or change how the HC9S08 uploads applications? This does not affect the speed of wireless communication?
  5. And, when I write my own applications, would I just “Make” them in CodeWarrior, and then upload them using XModem in XCTU? Or, should I add what I want to the App32Transparent program? And, is there an app pre-loaded into the HC9S08 already?

I know those are a lot of questions, but I really appreciate all the insight I can get. Thanks again!

  1. An XBEE PRO S2B programmable is not the same as a Series 2 or S2 XBee PRO nor is it the same as an XBEE PRO S2B. (Doesn’t have the extra processor denoted by the dash in the part number XBP24B???IT- ???) Your module should have the part number XBP24B???ITB ???. If so, make sure the 6 pin debug connector isn’t on backwards. Try resetting the debugger (unplug from computer for a few seconds and reinsert USB). Codwarrior debugger should ask for intervention to power cycle the module. This is because the flash is locked for the modules we send out of the factory. And it can’t debug with the flash locked. So it has 1 option after reboot. Erase the flash so a new program can be loaded.
    It is however compatible over the air with S2 and S2B. All modules in the Series 2 family will talk to each other. The S2B programmable needs code on the MC9S08 in order to work. If you want them drop in compatible, you will need to write the code to make it appear identical. You can use the Example App App32Transparent to do this. Right now Transparent mode uses polling for one UART and interrupt driven for the other. Polling means that it will miss characters from the UART if they come faster than the loop completion. You would need to change the polling to interrupt driven, as well as a few other things to make them appear identical. Then add in the extra features you would like it to do. (Like sample some DIO lines and only transmit a packet when all are low for longer than 1 second or control a digital POT or … whatever else)
    However, unlike the PROGRAMMABLE version of the XBEE-PRO S2B, the regular XBEE-PRO S2B is functionally identical to the XBEE-PRO S2, other than some additional AT commands.

  2. The bin file is titled: “App32T.abs.bin”

  3. What is the difference between “App32Transparent.mcp” and “App16Transparent.mcp”? The difference is that App16 is compiled to run on 16k of flash and 1k of RAM. (You would need to load the 16k bootloader to have this work). This would allow a larger reserved region where flash is not erased if loaded on a 32k part.

  4. Just to understand, the only reason I would want to change the bootloader code would be to make the application upload speed faster/slower or change how the HC9S08 uploads applications? This does not affect the speed of wireless communication?
    Correct, this would only speed up local UART upload speeds. Very handy when frequently changing the code during development.

  5. When I write my own applications, would I just “Make” them in CodeWarrior, and then upload them using XModem in XCTU? …
    Make your modifications in CodeWarrior to the App32Transparent.mcp. “Make” the bin file. Upload the file through XCTU.

  6. Additional info.
    If you have problems getting back into the bootloader you can
    A. reprogram the bootloader on the module, then upload the new App
    or
    B. Follow the instructions on the 2 pictures.
    Using XCTU uncheck RTS, check BREAK
    Press reset on the radio
    – The bootloader will not run the app in this state
    uncheck BREAK (XCTU will not send characters with the Break on)
    Click in the Terminal window so you can type
    Type Space or Enter
    – The bootloader menu will appear
    Now you can upload the newly compiled bin file.
    – Note that the bin file doesn’t need to be reselected if you have uploaded the app previously. Just “Make” after your change then upload it again.

Some questions. I am a high level Python programmer unfamiliar with CW (although 20 years ago I did a lot of 8051 work - long before IDE like CW existed)

  1. I see two sample apps - with with App16 and the other App32, why would I select one or the other?

  2. CW doesn’t find a project in the sample directory. What file should I be selecting/opening? What file is the root or core of the code?

Thanks

The Sample apps were designed keeping in mind that there are multiple flash sizes available on the market. The App16 was created at the same time to make sure that it would work if the part has only 16k of flash and 1k of RAM. Since you are working with the 32k programmable, use the App32.

Is debugger mandatory in order to program xbee?i have only the USB interface board.