You are on page 1of 18

Freescale Semiconductor AN2728

Rev. 1.2, 09/2004


Application Note

Demonstration Operation
Running the Packet Error Rate, Wireless UART, Accelerometer,
Range, and Lighting Demonstration Applications

1 Introduction Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 1
This application note describes how to run the following 2 Packet Error Rate Test . . . . . . . . . . . . . . . . . . 2
MC13192 & HCS08 based demonstration applications: 3 Wireless UART Demonstration . . . . . . . . . . . 9
4 Accelerometer Demonstration . . . . . . . . . . 11
• Packet Error Rate (PER)
5 Range Demonstration . . . . . . . . . . . . . . . . . 13
• Wireless UART 6 Lighting Demonstration . . . . . . . . . . . . . . . . 15
• Accelerometer (For more details, refer to
application note, AN2774/D.)
• Range
• Lighting

© Freescale Semiconductor, Inc., 2004. All rights reserved.


Packet Error Rate Test

2 Packet Error Rate Test


The Packet Error Rate (PER) test is a bidirectional test of the error rate for packets, which is used to verify
pre-production hardware. This test is designed to measure the sensitivity of the radio and the expected
power output at minimum and maximum levels. The test also performs a functional verification of the
Universal Asynchronous Receiver Transmitter (UART) interface.
The default packet count is 100 packets and the retry default is 3 packets, as specified in IEEE 802.15.4
Draft Specification. It incorporates some fixes, and it also includes a new function that allows you to
change the power output. The PER Channel Scan application is designed to send 20-byte packets from a
transmitter to a receiver. The receiver then calculates the number of missed packets and displays that
number using the UART interface. There are two applications associated with the PER test:
1. ideal.c — This application represents a known good board with characterized output power and
sensitivity, that exchanges data in packets with the device under test (DUT).
2. dut.c — The dut.c application represents the device under test.
Both of these applications are described in more detail in Section 2.3, “IDEAL.c Application,” and Section
2.4, “DUT.c Application.” The code for the Packet Error Rate test is found in the 'apps' directory under the
latest version of SMAC\apps\, for example:
d:\proj\Abel\SMAC\smac2_2\apps

2.1 Installation
Perform the following to install the PER test application. Unzip the application in the apps directory. The
application is located with other application demos as shown in Figure 1.

Figure 1. SMAC 3.0 Directory Contents

In the apps folder you should see the structure shown in Figure 2. The specific applications found in the
file structure will vary.

Demonstration Operation, Rev. 1.2


2 Freescale Semiconductor
Packet Error Rate Test

Figure 2. Apps Directory Contents

2.2 Required Hardware


The following hardware is required for this test:
• Two EVBs or SARDs in any combination
• One Background Debug Module (BDM) cable
• One or Two PCs with serial ports
• Two serial cables
• For GB60 OSC_SEL needs to connect to Y1 to select external clock

2.3 Required Software


The following software is required for this test:
• Metrowerks or BDM loader program
• Two terminal programs set to 38400 8-N-1 format with no flow control

Demonstration Operation, Rev. 1.2


Freescale Semiconductor 3
Packet Error Rate Test

2.4 Downloading Files


To set up the test, follow these steps:
1. Download the ideal.c application to one board as shown in Figure 3.

Figure 3. PER Test Application Project (ideal.c)

2. Download the dut.c application to another board as shown in Figure 4.

Figure 4. PER Test Application Project (dut.c)

Demonstration Operation, Rev. 1.2


4 Freescale Semiconductor
Packet Error Rate Test

2.5 ideal.c Application


The ideal.c application represents a known good board with characterized output power and sensitivity.
The process for the test is as follows:
1. The device begins by setting up a channel with the device under test. A 'set channel' request is used
to set up the channel. The output power for ideal is set to MIN_POWER.
2. When the DUT acknowledges the Ideal unit, the DUT immediately switches to the requested
channel and begins to listen on this channel. After a sufficient delay (which is significant), the
Ideal unit begins to transmit serialized packets with the following format:
xx xx xx xx 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10
where the xx's represent the serialized packet number. The Ideal unit transmits each serialize packet
in order until it reaches the 'RETRY_COUNT' defined in per.h. For each packet, if the Ideal device
does not receive an acknowledgment after the fourth attempt, the packet is considered lost, and the
Ideal device moves on to the next serialized packet. The total number of missed packets is reported
by the DUT when the Ideal device sends an 'echo data' command.
3. After the serialized packets are sent, the Ideal device requests that the DUT transmit a packet at
the minimum output power.
4. The Ideal device then waits for an acknowledgment from the DUT. When the acknowledgment is
received, the link quality (-dBm) of the received acknowledgment is measured and reported to the
user.
5. After the minimum power test, the Ideal device requests that the DUT set power to the maximum
and waits for an acknowledgment. Once the maximum power request is received and executed,
the link quality is measured and reported to the user.
This sequence is repeated for each of the 16 channels. Once the Ideal has completed its TX tests, it takes
on the Ideal-rx mode and becomes the receiver, to test the DUT's transmitter. In similar fashion, the Ideal
device in RX mode reports the total number of missed packets sent by the DUT.

2.5.1 Ideal.c Output


MC13192 Test Suite - MC13192 Reference

Test Name Channel no. missed pkt total packet Link Qual MIN Link Qual MAX

IDEAL PER-TX 0 N/A 100 67 36

IDEAL PER-TX 1 N/A 100 71 39

IDEAL PER-TX 2 N/A 100 72 42

IDEAL PER-TX 3 N/A 100 72 42

IDEAL PER-TX 4 N/A 100 71 41

IDEAL PER-TX 5 N/A 100 69 39

IDEAL PER-TX 6 N/A 100 69 39

IDEAL PER-TX 7 N/A 100 70 39

IDEAL PER-TX 9 N/A 100 72 40

Demonstration Operation, Rev. 1.2


Freescale Semiconductor 5
Packet Error Rate Test

IDEAL PER-TX 10 N/A 100 71 40

IDEAL PER-TX 11 N/A 100 73 41

IDEAL PER-TX 12 N/A 100 76 44

IDEAL PER-TX 13 N/A 100 81 49

IDEAL PER-TX 14 N/A 100 89 58

IDEAL PER-TX 15 N/A 100 95 58

IDEAL PER-RX 0 0 100 N/A N/A

IDEAL PER-RX 1 0 100 N/A N/A

IDEAL PER-RX 2 0 100 N/A N/A

IDEAL PER-RX 3 0 100 N/A N/A

IDEAL PER-RX 4 0 100 N/A N/A

IDEAL PER-RX 5 0 100 N/A N/A

IDEAL PER-RX 6 0 100 N/A N/A

IDEAL PER-RX 7 0 100 N/A N/A

IDEAL PER-RX 8 0 100 N/A N/A

IDEAL PER-RX 9 0 100 N/A N/A

IDEAL PER-RX 10 0 100 N/A N/A

IDEAL PER-RX 11 0 100 N/A N/A

IDEAL PER-RX 12 0 100 N/A N/A

IDEAL PER-RX 13 0 100 N/A N/A

IDEAL PER-RX 14 0 100 N/A N/A

IDEAL PER-RX 15 0 100 N/A N/A

2.6 dut.c Application


The device under test (DUT) application operates in a similar manner as the ideal.c application but
assumes the opposite role. When the Ideal is in TX mode the DUT is in RX mode, and vice-versa. The
functions and behavior are identical, except that the DUT prints output when the test is completed.

2.6.1 dut.c Output


Test Name Channel no. missed pkt total packet Link Qual MIN Link Qual MAX

DUT PER-RX 0 0 100 N/A N/A

DUT PER-RX 1 0 100 N/A N/A

DUT PER-RX 2 0 100 N/A N/A

DUT PER-RX 3 0 100 N/A N/A

Demonstration Operation, Rev. 1.2


6 Freescale Semiconductor
Packet Error Rate Test

DUT PER-RX 4 0 100 N/A N/A

DUT PER-RX 5 0 100 N/A N/A

DUT PER-RX 6 0 100 N/A N/A

DUT PER-RX 7 0 100 N/A N/A

DUT PER-RX 8 0 100 N/A N/A

DUT PER-RX 9 0 100 N/A N/A

DUT PER-RX 10 0 100 N/A N/A

DUT PER-RX 11 0 100 N/A N/A

DUT PER-RX 12 0 100 N/A N/A

DUT PER-RX 13 0 100 N/A N/A

DUT PER-RX 14 0 100 N/A N/A

DUT PER-RX 15 0 100 N/A N/A

DUT PER-TX 0 N/A 100 66 33

DUT PER-TX 1 N/A 100 64 33

DUT PER-TX 2 N/A 100 62 32

DUT PER-TX 3 N/A 100 63 32

DUT PER-TX 4 N/A 100 63 32

DUT PER-TX 5 N/A 100 66 37

DUT PER-TX 6 N/A 100 67 37

DUT PER-TX 7 N/A 100 67 37

DUT PER-TX 8 N/A 100 67 36

DUT PER-TX 9 N/A 100 66 35

DUT PER-TX 10 N/A 100 67 36

DUT PER-TX 11 N/A 100 68 36

DUT PER-TX 12 N/A 100 69 36

DUT PER-TX 13 N/A 100 67 39

DUT PER-TX 14 N/A 100 69 39

DUT PER-TX 15 N/A 100 73 40

*** FINISHED ***

Demonstration Operation, Rev. 1.2


Freescale Semiconductor 7
Packet Error Rate Test

2.7 Adjustments
In per.h there are several values expressed in '#define' statements that can be adjusted:

//Defines

#define PACKET_COUNT 100 (The number of packets sent)

#define TRANSMIT_COUNT 10 (The number of times an ack is sent)

#define TRANSMIT_DELAY 1000 (The delay between acks)

#define TX_DELAY 0x100 (The delay between each packet sent)

#define RETRY_COUNT 4 (The number of times to send each packet)

Demonstration Operation, Rev. 1.2


8 Freescale Semiconductor
Wireless UART Demonstration

3 Wireless UART Demonstration


The wireless UART application allows two GB60 boards with daughter cards or two SARD boards to
communicate two ways by sending ASCII characters using hyper-terminal on PC computers. This
application can be downloaded as a Metrowerks project and programmed into flash. The serial port on the
computer board is connected to the serial port on the PC. Hyper-terminal can be opened and set for 38.4
Kbauds with the following parameters: 1 stop bit, 8 data bits, and no control flow.

3.1 Installation
The Wireless UART demonstration is in the 'apps' directory under the latest version of SMAC\apps\, for
example:
d:\proj\Abel\SMAC\smac2_2\apps

3.2 Required Hardware


The following hardware is required for this test:
• Two EVBs or SARDs in any combination
• BDM cable
• One or two PCs with serial ports
• Two serial cables
• For GB60 OSC_SEL needs to connect to Y1 to select external clock

3.3 Required Software


The following software is required for this test:
• Metrowerks or BDM loader program
• Two terminal programs set to 38400 8-N-1 format with no flow control

3.4 Downloading Files


To set up the test, download the designated target into both devices. The target used is dependent on the
target board. For example, GB60 target is meant for the GB60 Evaluation board and the SARD is for the
1319SARD board. The application window appears as shown in Figure 5.

Demonstration Operation, Rev. 1.2


Freescale Semiconductor 9
Wireless UART Demonstration

Figure 5. Wireless UART Test Application Project

Demonstration Operation, Rev. 1.2


10 Freescale Semiconductor
Accelerometer Demonstration

4 Accelerometer Demonstration
The Accelerometer Demonstration is programmed into flash from the factory and is optimized for low
power consumption. The output power is set to minimum output power (-16.6 dBm typical) versus the
nominal 0 dBm output power setting for 802.15.4 and Zigbee applications. The minimum output power
setting (-16.6 dBm typical) should not be used for range testing and verification. To test the effective range
of the boards, use the Range Demonstration application which has the output power set to the nominal 0
dBm output power setting. The Range Demonstration should be uploaded to the board's program flash
memory and run from there.
The accelerometer demonstration application uses two SARD boards that transmit X, Y, and Z data from
one SARD board to another SARD board. The second SARD board is connected to a PC via a serial port.
The PC runs a GUI interfaces that displays the Accelerometer sensor data on the PC screen. The
Transmitter board reads the X, Y, and Z accelerometer sensors and transmits the data to the receiver board
with the following data structure.
Send ascii x character

Send x accer sensor value (0-255,8bits)

Send ascii y character

Send y accer sensor value (0-255,8bits)

Send ascii z character

Send z accer sensor value (0-255,8bits)

The receiver receives these packets and sends the data to the PC via the serial port. The data is then
displayed in various formats on the PC. When first turned on, the window appears as shown in Figure 6.

Demonstration Operation, Rev. 1.2


Freescale Semiconductor 11
Accelerometer Demonstration

Figure 6. Accelerometer Demonstration Interface

First, the COM port must be selected to which the serial port is connected to. Next, the desired function
can be selected. The GUI can display raw data, cursor position, tilt and scope.

4.1 Installation
Use the following steps to install this application.
1. UNZIP this in the apps directory with the other application demonstrations. This demonstration is
in the 'apps' directory under the latest version of SMAC 3_0\apps.
2. Download accelerometer.c to one SARD board.
3. Download accelerometer.c to another SARD board.
4. Set up the transmit board by holding down any one of the switches and setting switch S105 to the
On position. The other board, by default, comes up in receive mode.
5. Connect the RX serial port to the PC.
6. Run Triax v1.0.exe and select the desired COM port.
After the units are turned on and the GUI is running on the PC, the different functions can be selected and
accelerometer data display in different formats. Again, for more detailed information on the Accelerometer
Demonstration functionality, refer to Application Note AN2774/D.

Demonstration Operation, Rev. 1.2


12 Freescale Semiconductor
Range Demonstration

5 Range Demonstration
This application continuously transmits or receives a packet. If switch 1 is depressed during start up, then
a packet is continuously transmitted and the second LED 2 flashes. If switch 2 is depressed during start up,
then the device is set into continuous receive mode and the bottom LED 1 flashes.

5.1 Installation
The Range demonstration is in the 'apps' directory under the latest version of SMAC\apps\, for example:
d:\proj\Abel\SMAC\smac2_2\apps

5.2 Required Hardware


The following hardware is required for this test:
• Two EVBs or SARDs in any combination
• BDM cable
• For GB60 OSC_SEL needs to connect to Y1 to select external clock

5.3 Required Software


The following software is required for this test:
• Metrowerks or BDM loader program

5.4 Downloading Files


To set up the test, download the designated target into both devices. The target used is dependent on the
target board. For example, GB60 target is meant for the GB60 Evaluation board and the SARD is for the
1319SARD board. The application window should appear as shown in Figure 7.

Demonstration Operation, Rev. 1.2


Freescale Semiconductor 13
Range Demonstration

Figure 7. Range Test Application Project

Demonstration Operation, Rev. 1.2


14 Freescale Semiconductor
Lighting Demonstration

6 Lighting Demonstration
This section describes the Lighting Demonstration capabilities.

6.1 Controller Select and Operation


Upon power-up or out of reset, any pushbutton can be pressed and held to manually select an operating
channel. On power-up or reset, all LEDs will flash for 1 second to indicate the unit is a controller. Next,
the group number (i.e. SERNUM) LED is flashed on for 1 second to identify the group. If the channel is
being selected manually, the respective pushbutton is released, and the channel LED will flash for one
second. If channel selection is automatic, all LEDs will be lit while the unit searches for the clearest
channel. Once this channel is detected, the respective LED will flash on for 1 second. Initialization of the
controller is now complete.
To use the controller, first, PB0 is depressed to wake the controller out of a very low-power mode (i.e.
MCU in STOP3 and MC13192 in Reset. The LEDs will cycle on each PB0 depression to select a desired
remote device. If the pushbutton remains inactive for appx.4 seconds, the controller will return to the very
low power state. Next, PB1 is depressed in the same manner as PB0 to select the desired remote device's
light (i.e. LED). Now, PB2 can be depressed to toggle the destination remote's (as selected by PB0) LED
(as selected by PB1) on/off. The remote device acknowledges the toggle command, and if received
successfully by the controller, will be indicated by flashing all LEDs on one time. Instead of PB2, PB3
may be depressed to find the status of the selected device's light. If the status is received successfully from
by controller, the first two LEDs will be lit and the last LED indicates the status. If either the remote
acknowledge or status is not received by the controller, all the LEDs will blink on/off several times. After
any complete operation, the controller automatically returns to the low-power state. The program assumes
all LEDs are connected to the same PORT. The target platform may be selected in the pub_def.h file. Many
application specific details are in remote_controller.h.

6.2 Device Select and Operation


On power-up or reset, the LEDs will “walk” for 1 second to indicate the unit is a device. Next, the group
number (i.e. SERNUM) LED is flashed on for 1 second to identify the group. The unit then pauses and
waits for the operator to select a desired channel by pressing the corresponding pushbutton. The selected
channel will flash on the LED for 1 second. The unit again pauses and waits for the operator to select the
desired device number by pressing the corresponding pushbutton, The selected device number will flash
on the LED for 1 second. Initialization of the device is now complete.
To use the device, any pushbutton may be depressed to toggle the status of the corresponding LED. This
is for local control. If addressed (and if the SERNUM matches), the controller may request any LED to
toggle, or the controller may request the status of an individual LED. The device will retransmit any data
received and intended for another device within the SERNUM grouping, acting as a repeater. The device
has a unique “group” number (i.e. SERNUM) and device number (i.e. DEVICE_NUM). The program
assumes all LEDs are connected to the same PORT. The target platform may be selected in the pub_def.h
file. Many application specific details are in lighting_demo_device.h

Demonstration Operation, Rev. 1.2


Freescale Semiconductor 15
Lighting Demonstration

6.3 Installation
The Lighting demonstration is in the 'apps' directory under the latest version of SMAC\apps\, for example:
d:\proj\Abel\SMAC\smac2_2\apps

6.4 Required Hardware


The following hardware is required for this test:
• Two EVBs or SARDs in any combination
• BDM cable
• For GB60 OSC_SEL needs to connect to Y1 to select external clock

6.5 Required Software


The following software is required for this test:
• Metrowerks or BDM loader program

6.6 Downloading Files


To set up the test, follow these steps:
1. Open the project named lighting_demo_controller.ncp.
2. Download the code with the appropriate target. For example, a GB60 or SARD Figure 8.
3. Open the project named Lighting_demo_device.mcp.
4. Download the code with the appropriate target. For example, a GB60 or SARD. Figure 9

Figure 8. lighting_demo_controller.mcp project

Demonstration Operation, Rev. 1.2


16 Freescale Semiconductor
Lighting Demonstration

Figure 9. Lighting_demo_device.mcp project

Demonstration Operation, Rev. 1.2


Freescale Semiconductor 17
How to Reach Us: 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
USA/Europe/Locations Not Listed: hereunder to design or fabricate any integrated circuits or integrated circuits based on the information
Freescale Semiconductor Literature Distribution Center in this document.
P.O. Box 5405 Freescale Semiconductor reserves the right to make changes without further notice to any products
Denver, Colorado 80217 herein. Freescale Semiconductor makes no warranty, representation or guarantee regarding the
1-800-521-6274 or 480-768-2130 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
Japan: and all liability, including without limitation consequential or incidental damages. “Typical” parameters
Freescale Semiconductor Japan Ltd. that may be provided in Freescale Semiconductor data sheets and/or specifications can and do vary
Technical Information Center in different applications and actual performance may vary over time. All operating parameters,
3-20-1, Minami-Azabu, Minato-ku including “Typicals”, must be validated for each customer application by customer’s technical experts.
Tokyo 106-8573, Japan Freescale Semiconductor does not convey any license under its patent rights nor the rights of others.
81-3-3440-3569 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
Asia/Pacific: sustain life, or for any other application in which the failure of the Freescale Semiconductor product
Freescale Semiconductor Hong Kong Ltd. could create a situation where personal injury or death may occur. Should Buyer purchase or use
2 Dai King Street Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall
Tai Po Industrial Estate indemnify and hold Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and
Tai Po, N.T., Hong Kong distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney
852-26668334 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
Home Page: negligent regarding the design or manufacture of the part.
http://motorola.com/semiconductors
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. 2004.

AN2728
Rev. 1.2
09/2004

You might also like