NXP Semiconductors MC13224V, MC13226V User Manual

MC1322x Simple Media Access
Controller Demonstration
Applications
User's Guide
Document Number: 22xSMACDAUG
Rev. 1.3
09/2011
How to Reach Us:
Home Page:
www.freescale.com
E-mail:
support@freescale.com
USA/Europe or Locations Not Listed:
Freescale Semiconductor Technical Information Center, CH370 1300 N. Alma School Road Chandler, Arizona 85224 +1-800-521-6274 or +1-480-768-2130 support@freescale.com
Europe, Middle East, and Africa:
Freescale Halbleiter Deutschland GmbH Technical Information Center Schatzbogen 7 81829 Muenchen, Germany +44 1296 380 456 (English) +46 8 52200080 (English) +49 89 92103 559 (German) +33 1 69 35 48 48 (French) support@freescale.com
Japan:
Freescale Semiconductor Japan Ltd. Headquarters ARCO Tower 15F 1-8-1, Shimo-Meguro, Meguro-ku, Tokyo 153-0064, Japan 0120 191014 or +81 3 5437 9125 support.japan@freescale.com
Asia/Pacific:
Freescale Semiconductor Hong Kong Ltd. Technical Information Center 2 Dai King Street Tai Po Industrial Estate Tai Po, N.T., Hong Kong +800 2666 8080 support.asia@freescale.com
For Literature Requests Only:
Freescale Semiconductor Literature Distribution Center P.O. Box 5405 Denver, Colorado 80217 1-800-521-6274 or 303-675-2140 Fax: 303-675-2150 LDCForFreescaleSemiconductor@hibbertgroup.com
Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document.
Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale Semiconductor makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. “Typical” parameters that may be provided in Freescale Semiconductor data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including “Typicals”, must be validated for each customer application by customer’s technical experts. Freescale Semiconductor does not convey any license under its patent rights nor the rights of others. Freescale Semiconductor products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part.
IAR Systems, IAR Embedded Workbench, C-SPY, visualSTATE, From Idea to Target, IAR KickStart Kit, IAR PowerPac, IAR YellowSuite, and IAR are trademarks or registered trademarks owned by IAR Systems AB.
Copyright © 2007 IAR Systems AB.
ARM is the registered trademark of ARM Limited. ARM7TDMI-S is the trademark of ARM Limited. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners.
© Freescale Semiconductor, Inc. 2005, 2006, 2007, 2008, 2009, 2010, 2011. All rights reserved.
Contents
About This Book. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
Available Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Definitions, Acronyms, and Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi
Chapter 1 Generating an SMAC Application and Port Configuration
1.1 Loading Applications Into a Board Using the JTAG J-Link ARM Debugger . . . . . . . . . . . . . . 1-6
1.2 JTAG Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
1.3 UART/USB Virtual COM Port Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9
Chapter 2 Wireless UART Demonstration
2.1 Generating a Project From BeeKit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
2.2 Open, Compile and Execute the Wireless UART. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Chapter 3 Connectivity Test
3.1 Loading the Connectivity Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
3.2 UART/USB Virtual Com Port Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
3.3 Starting the Connectivity Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
3.4 Connectivity Test Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5
3.4.1 Test Mode Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
3.4.2 Spectrum Analyzer Captures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
3.5 Packet Error Rate (PER) Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
3.5.1 Starting the PER Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
3.5.2 PER operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11
3.6 Range Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12
3.7 Crystal Adjustment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13
Chapter 4 Accelerometer Demonstration
4.1 Loading the Accelerometer Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
4.2 Board Setup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
4.3 Board One Setup (PC_Radio Board) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
4.4 Board Two Setup (Accelerometer Board) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
4.5 PC Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
4.6 Verifying Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
4.7 Setting Up the Calibration Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
Freescale Semiconductor i
Chapter 5 Low Power Bell Demonstration
5.1 Generating the Project From BeeKit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
5.2 Open, Compile and Execute the Low Power Bell Application . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
Chapter 6 Generic Application Demonstration
6.1 Generating a Project From BeeKit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1
6.2 Open, Compile and Execute the Generic Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1
Chapter 7 Simple ZigBee Test Client (SZTC) Demonstration
7.1 Generating a Project From BeeKit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1
7.2 Testing the SZTC with the WirelessUART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1
Chapter 8 Repeater Demonstration
8.1 Generating a Project From BeeKit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1
8.2 Open, Compile and Execute the Repeater . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
8.3 Repeater Menu, Configuration and Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
8.4 Running the Repeater Demonstration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
8.4.1 Creating a Sniffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
8.4.2 Running a Dummy Repeater. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
Chapter 9 Weather Station Demonstration
9.1 Generating a Project From BeeKit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1
9.2 Open, Compile, and Load the Weather Station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3
9.3 Weather Station PC Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5
9.3.1 Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5
9.3.2 Connecting to a Network Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-6
9.3.3 Data Packet Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8
9.3.4 Loading a Pre-existing Log File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8
Chapter 10 Over The Air Programmer Demonstration
10.1 Generating a Project From BeeKit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
10.2 Open, Compile, and Load the OTAP Programmer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
10.3 Downloading an OTAP-enabled Image to the OTAP Programmer Board. . . . . . . . . . . . . . . . 10-4
10.4 Downloading an OTAP-enabled Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6
10.5 Transmitting the New Image to the OTAP-enabled Board . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-9
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
ii Freescale Semiconductor
10.5.1 Using the Serial Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-9
10.5.2 Using The LCD Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-11
10.6 Verifying the Transmitted Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-12
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
Freescale Semiconductor iii
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
iv Freescale Semiconductor
About This Book
This guide provides a detailed description of the MC1322x Simple Media Access Controller (MC1322x SMAC) demonstration applications. The demonstration applications are delivered as ANSI C source code and are included in the MC1322x SMAC Codebase. The Codebase is incorporated into the Freescale BeeKit Wireless Connectivity Toolkit. See the BeeKit Wireless Connectivity Toolkit User’s Guide (BKWCTKUG) and the BeeKit on-line help for more information.
This guide explains how to run various MC1322x SMAC demonstration applications and provides information that allows users to more easily take advantage of these demonstration applications or modify the applications to fit their specific needs.
The demonstration applications shown in this guide are compatible with previous SMAC demonstrations at the protocol level. However, the applications that employ security will be different because the MC1322x SMAC takes advantage of the Advanced Security Module (ASM, AES based) security module included in the MC122x Platform in a Package (PiP). The MC1322x device provides a more robust security approach. For more information about security and the MC1322x, see the appropriate MC1322x documentation available at www.freescale.com/zigbee.
The MC1322x SMAC API is similar to previous SMAC APIs. For more detail about the APIs, see the MC1322x Simple Media Access Controller (SMAC) Reference Manual (22xSMACRM).
Available Devices
The MC1322x family is available as two part numbers. These device types differ only in their ROM contents, all other device hardware, performance, and specifications are identical:
MC13224V - this is the original version and is the generic part type.
— The MC13224V is intended for most IEEE 802.15.4 applications including MAC-based,
ZigBee-2007 Profile 1, and ZigBee RF4CE targets.
— It has a more complete set of peripheral drivers in ROM.
MC13226V - this is a more recent version and is provided specifically for ZigBee-2007 Profile 2 (Pro) applications. Only the onboard ROM image has been changed to optimize ROM usage for the ZigBee Pro profile and maximize the amount of available RAM for application use.
— The IEEE MAC/PHY functionality has been streamlined to include only that functionality
required by the ZigBee specification. The MAC functionality is 802.15.4 compatible.
— For a typical application, up to 20 kbytes more of RAM is available versus the M13224V
— Some drivers present in the MC13224 ROM have been removed and these include the ADC,
LCDfont, and SSI drivers. These drivers are still available as library functions, but now compile into the RAM space.
— The Low Level Component (LLC) functionality has also been streamlined for the ZigBee
specification
NOTE
When running the Freescale IEEE 802.15.4 MAC (or a related stack) on the MC1322x platform, neither beaconing or GTS are supported.
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
Freescale Semiconductor iii
See the MC1322x Reference Manual (Document No MC1322xRM), for information on using applications on these devices.
Audience
This document is intended for application developers generating MC1322x SMAC demonstration applications from the Freescale BeeKit Wireless Connectivity Toolkit or modifying these applications as a starting point for proprietary applications.
Organization
This document is organized into ten chapters.
Chapter 1 Introduction — This chapter shows how to generate an SMAC demonstration
application using BeeKit.
Chapter 2 Wireless UART — Provides a detailed description of MC1322x SMAC Wireless
UART demonstration application.
Chapter 3 Connectivity Test — Provides an easy way to test the RF performance of the
transceiver for basic transmitter and receiver tests. It includes test mode (continuous tx, modulated, unmodulated, etc.); Packet Error Rate and Range (LQI measurements).
Chapter 4 Accelerometer Test — Provides an overview of the Accelerometer
Demonstration application, which shows various uses for the Freescale X, Y, and Z axes accelerometers.
Chapter 5 Low Power Bell — Shows how to implement different low power options.
Chapter 6 Generic Application — Provides a start template for users what want to add their
own application.
Chapter 7 Simple ZTC — Allows users to test the SMAC primitives by sending special data
frames through the Serial/USB port.
Chapter 8 Repeater— Implements a simple repeater which extends the range between two
boards running an SMAC application demonstration.
Chapter 9 Weather Station— Simulates a Weather Station and shows the use of Freescale
sensors for acceleration and pressure.
Chapter 10 Over The Air Programmer (OTAP) — Allows users to update a board’s FLASH
remotely without a physical connection. Given an OTAP enabled application and an OTAP programmer, users can replace an existing application with a new application.
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
iv Freescale Semiconductor
Revision History
The following table summarizes revisions to this document since the previous release (Rev. 1.2).
Revision History
Location Revision
Chapters 3 and 6 Various software updates.
Definitions, Acronyms, and Abbreviations
The following list defines the acronyms and abbreviations used in this document.
AES Advanced Encryption Standard
API Application Program Interface
ASM Advanced Security Module
BDM Background Debug Module
BDM debugger A debugger using the BDM interface for communication with the MCU. An
example is the P&E BDM Multilink debugger for HCS08.
CBC Cipher Block Chaining.
CBC-MAC Cipher Block Chaining Message Authentication Code.
CCM Counter with CBC-MAC
CTR Counter.
dBm Decibels referred to one milliwatt.
ED Energy Detect.
EN End Node - Evaluation Board.
EVB Evaluation Boards.
EVK Evaluation Kit
EWW Embedded Workbench IDE work space file
GUI Graphical User Interface
IDE Integrated Development Environment
LP Low Power
MAC Media Access Control
MAC Message Authentication Code
MCU MicroController Unit
NCB Network Coordinator Board
NVM None-Volatile Memory
OTAP Over The Air Programming
PC Personal Computer
PCB Printed Circuit Board
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
Freescale Semiconductor v
PiP Platform in Package
RX Reception
S19 S - Record. 'S19' is the file extension used for the Freescale binary image format.
The S19 file encapsulates the binary image as a list of ASCII records. Each record contains a length -, address -, data - and checksum field. The 16 bit address field allows a memory space for up to 64 KB. The S19 can be generated with CodeWarrior IDE and is the product from the linking process. S19 does not contain additional information to a debugger (where to look for source files).
Safe Mode Boot The Embedded Bootloader boots up using safe default system values.
SMAC Simple Media Access Control.
SN Sensor Node Evaluation Board.
TX Transmission.
References
The following sources were referenced to produce this book:
[1] Freescale 802.15.4 MAC/PHY Software Reference Manual (802154MPSRM)
[2] Freescale MC1322x Simple Media Access Controller (SMAC) Reference Manual (22xSMACRM)
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
vi Freescale Semiconductor
Chapter 1 Generating an SMAC Application and Port Configuration
This chapter provides an overview of how to generate an SMAC demonstration application using BeeKit. This chapter only provides an overview of how to generate an SMAC demonstration application. For more details on installing BeeKit and BeeKit operation, see the BeeKit Wireless Connectivity Toolkit User’s Guide (BKWCTKUG).
This chapter also shows how to set up a virtual UART/USB COM port. Once the ports are configured, refer to the appropriate application chapter in this guide.
1. Install and then launch BeeKit and the BeeKit main window appears as shown in Figure 1-1.
Figure 1-1. BeeKit Graphical User Interface
2. Select the SMAC Codebase as shown in Figure 1-2.
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
Freescale Semiconductor 1-1
Generating an SMAC Application and Port Configuration
Figure 1-2. selecting SMAC Codebase
In BeeKit, a Codebase is a set of files and rules that permit users to generate the final applications. This step is important, because the SMAC Codebase is different than the Codebase of MAC and BeeStack.
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
1-2 Freescale Semiconductor
3. Create a new project as shown in Figure 1-3.
Generating an SMAC Application and Port Configuration
Figure 1-3. Creating a new project
If users create a new project and there is not a an existing solution, then users are also creating a solution. The solution must have a name. Specify a name for the solution.
4. Add other required projects for the evaluation as shown in Figure 1-4.
Figure 1-4. Adding a New Project to a Existing Solution
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
Freescale Semiconductor 1-3
Generating an SMAC Application and Port Configuration
5. Modify the project properties as shown in Table 1-1.
Tab l e 1-1. Software Component Properties
Component Property Description
Security Enabled Enables the security Module to automatically encrypt the
information sent and received.
Promiscuous Mode If set to true, the SMAC Code Bytes are not sent prior to the
message.
Security Type This is the security engine used if the security enabled property
is true.
Security Default KEY0 Less Significative 32 bit Word of the 128 bits to be used as key
on the ciphering engine.
Security Default KEY1 Second Significative 32 bit Word of the 128 bits to be used as
key on the ciphering engine.
SMAC
PLM
Security Default KEY2 Third Significative 32 bit Word of the 128 bits to be used as key
on the ciphering engine.
Security Default KEY3 More Significative 32 bit Word of the 128 bits to be used as key
on the ciphering engine.
Security Default COUNTER0 Less Significative 32 bit Word of the 128 bits to be used as initial
counter on the ciphering engine.
Security Default COUNTER1 Second Significative 32 bit Word of the 128 bits to be used as
initial counter on the ciphering engine.
Security Default COUNTER2 Third Significative 32 bit Word of the 128 bits to be used as
initial counter on the ciphering engine.
Security Default COUNTER3 More Significative 32 bit Word of the 128 bits to be used as
initial counter on the ciphering engine.
Target hardware Allows board selection.
LCD Enabled Includes support for LCDs.
Default SCI Port Selects the SCI port. Freescale ZigBee boards usually have
SCI Port 1 connected to a DB9 connector and SCI port 2 connected to a USB connector.
MCU Version Can select either MC13224 or MC13226.
Default Channel Default starting channel in the application.
Output Power Initial power output configuration.
Baud Rate Baud rate to be set at the default SCI port for this application
App
1-4 Freescale Semiconductor
OTAP Enabled Enables the OTAP Module to allow over the air programming of
OTAP Request Code If the OTAP Module is enabled the application will switch to
OTAP Device Id This ID distinguishes between different devices identified by an
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
the application.
OTAP mode when this OTAP Request Code is received.
OTAP Programmer.
Generating an SMAC Application and Port Configuration
6. Users must now validate the solution as shown in Figure 1-5. The validation process helps users find possible inconsistencies between the selected hardware and properties.
Figure 1-5. Validating a Solution
7. Users must now export the solution as shown in Figure 1-6.
Figure 1-6. Exporting a Solution
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
Freescale Semiconductor 1-5
Generating an SMAC Application and Port Configuration
1.1 Loading Applications Into a Board Using the JTAG J-Link ARM Debugger
After exporting from BeeKit, the projects are generated as a .eww file. Perform the following tasks to load the application to a board, using the IAR Embedded Workbench IDE. This example uses the repeater application.
1. As shown in Figure 1-7, open the My Solution.eww file.
Figure 1-7. Opening a project
2. Make the project by clicking the Make button (Figure 1-8) which is located at the top of the IAR Embedded Workbench main Window as shown in Figure 1-9.
Figure 1-8. Make Button
Figure 1-9. IAR Embedded Workbench Main Window
3. Connect the J-Link to the target board.
4. Click the Debug button Figure 1-10 which is located at the top of the IAR Embedded Workbench main window as shown in Figure 1-9.
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
1-6 Freescale Semiconductor
Figure 1-10. Debug
Generating an SMAC Application and Port Configuration
5. The application will start to download, to run the application press F5 key or click the Go button
Figure 1-11
Figure 1-11. Go
1.2 JTAG Debugging
1. To debug an application select “Debug“ at the Work space window as shown in Figure 1-12.
Figure 1-12. IAR Embedded Workbench Work Space Debug and Release Window
2. Right click on the project name and select “Options“ as shown in Figure 1-13.
Figure 1-13. IAR Embedded Workbench Options Menu
3. At the debugger category on the Setup tab, select the “J-Link/J-Trace“ option as shown in
Figure 1-14.
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
Freescale Semiconductor 1-7
Generating an SMAC Application and Port Configuration
Figure 1-14. Debugger Setup
4. Ensure that the JTAG Debugger is connected to the PC and to the board.
5. On the Project window press the [CTRL]+[D] keys or just click the debug button shown in
Figure 1-15 to begin the debugging session.
Figure 1-15. Debug Button
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
1-8 Freescale Semiconductor
Generating an SMAC Application and Port Configuration
1.3 UART/USB Virtual COM Port Setup
This section describes how to set up a virtual COM port for the following demonstration applications:
Chapter 2, “Wireless UART Demonstration”
Chapter 3, “Connectivity Test”
Chapter 6, “Generic Application Demonstration”
Chapter 7, “Simple ZigBee Test Client (SZTC) Demonstration”
Chapter 8, “Repeater Demonstration”
Chapter 9, “Weather Station Demonstration”
Chapter 10, “Over The Air Programmer Demonstration”
Attach two boards to two PCs. This allows communication using a PC terminal communications program. The two boards can be attached to two different serial ports of the same PC if needed, but Freescale recommends using two PCs when possible.
1. Connect each of the boards to a separate PC either with an RS-232 cable or a USB cable. If using a USB cable, a corresponding USB driver is required. Freescale recommends a direct USB connection. Do not use a USB hub. This driver is located in the following directory:
<INSTALL DIR>\Freescale\Drivers
The BeeKit CD image is available from the Freescale ZigBee web site at
www.freescale.com/zigbee.
2. To check which COM port is being used by the USB, do the following:
a) Open the Windows System Properties window using Start->Settings->Control Panel->System.
b) Select the Hardware tab, and click the Device Manager button. The Device Manager window
appears as shown in Figure 1-16.
Figure 1-16. COM Port Determination in Device Manager
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
Freescale Semiconductor 1-9
Generating an SMAC Application and Port Configuration
c) Scroll to the Ports label and expand the tree by clicking the “+” sign. This shows the COM ports
in the system.
d) As shown in Figure 1-16, the COM Port chosen by the system is titled
USB Serial Port (COM7).
3. If the COM port chosen is not a port numbered between Ports 1-10, then perform the following tasks:
a) Double click on USB Serial Port in the Device Manager window. The Properties window
appears.
b) Select the Port Settings tab, and then click on the Advanced button.
c) Go to the COM Port Number drop down menu and select a COM port between 1-10 that is not
already in use.
d) Open the Windows System Properties window using Start->Settings->Control Panel->System.
Select the Hardware tab, and click the Device Manager button. The Device Manager window appears as shown in Figure 1-16.
e) Check to ensure the required port appears.
f) Close the Device Manager window.
4. Proceed to generating the project in BeeKit as described in the appropriate application chapter.
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
1-10 Freescale Semiconductor
Chapter 2 Wireless UART Demonstration
The Wireless UART application allows the Freescale ZigBee family of boards to communicate at typematic rates from one board to another over RS-232 cables or USB virtual COM ports. In order to execute this demonstration application the user will need a tool to send and receive characters over two serial ports in addition to what Freescale supply.
This chapter provides a simplified example. Currently, the code cannot be used as a cable replacement. If cable replacement is the ultimate goal, then queues, buffers, and other constructs must be added to increase the reliability and efficiency of this demonstration.
Prior to loading the Wireless UART application, the application must be generated using BeeKit, as described in the BeeKit Wireless Connectivity Toolkit User’s Guide.
The MC1322x SMAC Wireless UART demonstration application is protocol compatible with previous SMAC Wireless UART applications (those that run on the MC1319x, MC1320x, and MC1321x boards). However, if security is enabled, the MC1322x SMAC Wireless UART demonstration application is incompatible with previous SMAC versions.
See Section 1.3, “UART/USB Virtual COM Port Setup” for information about how to set up a virtual COM port for this application.
2.1 Generating a Project From BeeKit
Once the UART/USB virtual ports have been configured, continue with generating the project from BeeKit as follows.
1. Open BeeKit (Start->Programs->Freescale BeeKit->Freescale BeeKit).
2. In BeeKit, select the MC1322x SMAC codebase (File menu -> Select Codebase...)
3. Click on File -> New Project and choose the Wireless UART template.
4. Follow the steps as displayed in the New Project wizard.
5. Configure the properties as needed.
6. Validate the solution.
7. Export the solution.
8. BeeKit creates the project folder with the structure as shown in Figure 2-1.
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
Freescale Semiconductor 2-1
Wireless UART Demonstration
Figure 2-1. BeeKit Created, Wireless UART Directory Structure
For further details about how to use BeeKit, see the BeeKit Wireless Connectivity Toolkit User’s Guide (BKWCTKUG).
2.2 Open, Compile and Execute the Wireless UART
1. Using the IAR Embedded Workbench, open the Wireless UART work space (Wireless UART.eww) as shown in Figure 2-2.
Figure 2-2. Opening Wireless UART Work Space
2. Select “Release” in the Workspace window.
3. Click on Project -> Rebuild All.
The folders Release, Debug, and the settings are now created in the project structure as shown in
Figure 2-3.
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
2-2 Freescale Semiconductor
Wireless UART Demonstration
Figure 2-3. Release, Debug, and Settings
The WirelessUART.bin file is placed at the following directory location:
[Project Directory]\Release\Exe\
4. Load the WirelessUART application to the boards. Connect the JTAG interface to the board, then click the Debug button on the IAR Embedded Workbench IDE.
5. Use a PC terminal communications program, such as Hyper Terminal, and set the correct baud rate, data bits, parity, COM port, and flow control. Figure 2-4 shows the default MC1322x SMAC RS-232 settings.
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
Freescale Semiconductor 2-3
Figure 2-4. Default SMAC RS-232 Settings
Wireless UART Demonstration
6. In the PC terminal program, set the properties in the optional settings as shown in Figure 2-5.
Figure 2-5. Additional Terminal Program Settings
7. Start the serial communication software and send any characters using the keyboard. The other board answers with the “Wireless Typematic Demo.“ message as shown in Figure 2-6.
Figure 2-6. Wireless UART Welcome Message
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
2-4 Freescale Semiconductor
Wireless UART Demonstration
8. Type some characters in the Hyper Terminal Session (Board 1, shown in Figure 2-7) and the typed message appears on the other PC Hyper Terminal Session (Board 2, also shown in Figure 2-7).
Figure 2-7. Wireless UART Board 1 (Sending) and Board 2 (Receiving)
This is a two-way communication protocol where the boards will retry their packets up to three times if an acknowledgement is not received. This application highlights a very basic MC1322x SMAC Wireless UART implementation and as already stated, because it is a basic demonstration application, it is not intended for large file transfers.
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
Freescale Semiconductor 2-5
Wireless UART Demonstration
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
2-6 Freescale Semiconductor
Chapter 3 Connectivity Test
The connectivity test evaluates the basic connectivity between two transceivers. A transmitter and a receiver application are required. The connectivity test supports the following functionality:
Configure the transceiver in a specific test mode in order to test the transceiver RF performance. These test mode are:
— Modulated Transmission
— Unmodulated Transmission
— Pulse PRBS Transmission
—IDLE
Measure the percentage of packet losses over a certain channel as well as the Link Quality Indicator of each packet received.
Indicate the range of a signal using the Link Quality Indicator.
In both modes parameters such as the channel number and power level can be modified. This allows users to execute all tests in every channel using different power values.
The application includes a reference oscillator frequency output at a pin useful for frequency measurement and adjustment when required.
Two possible interfaces are implemented to use this application: a manual interface through push buttons or menus for a serial interface. Only one interface can be selected, both interfaces can not been working at the same time. The interface type is selected when creating the project with the Freescale BeeKit.
For manual interface, the function of each button is as follows:
SW1: Selects the application mode. (Channel Change, Power Adjust, Test to perform, etc.) see
Figure 3-1.
SW2: Increases a value.
— For TX the possible options are: IDLE (0), PSRB (1), PER (2), Range Test TX (3), Continuous
Modulated (4) and Continuous Unmodulated (5).
— For RX mode the possible options are: IDLE (0), Continuous reception (1), PER(2) and Range
Test RX (3).
— The values are momentarily shown at the LEDs then LEDs show current application mode.
SW3: To decrease the value.
SW4: To start the test (used only at PER test)
MC1322x SMAC Demonstration Application User’s Guide, Rev. 1.3
Freescale Semiconductor 3-1
Loading...
+ 63 hidden pages