4REVISION HISTORY ...................................................................... 34
Rev B 0006-00-08-02-000 Page 3 of 34
FreeStar Pro SMAC Programmers’ Guide
1 Overview
1.1 DESCRIPTION
The ZFSM201-EVB-1 FreeStar Pro Evaluation Board serves as an interface, evaluation and
development tool enabling the user to demonstrate, and evaluate the capabilities of the CEL
ZFSM-201-1, FreeStar Pro Module.
At the heart of the CEL ZFSM-201-1 is the Freescale MC13224V Platform-in-Package (PiP)
transceiver, a 32-bit ARM-based ZigBee radio module and a third-generation 2.4GHz IEEE®
802.15.4 platform.
The 32-bit ARM7 processor and extensive on-chip memory allows designers to eliminate the
peripheral host processors often required by 8- and/or 16-bit transceiver solutions. The high
level of integration also helps to reduce component count, lowering power consumption and
reducing overall system cost.
The evaluation kit provides the end user the ability to quickly become familiar with both the
ZFSM-201-1 FreeStar Pro module’s hardware and software. The evaluation boards come
preloaded with firmware demonstrating a wireless link and communicating with the supplied
FreeStar Pro Test Tool Graphical User Interface (GUI).
The full application source code of the pre-programmed firmware is based on Freescale’s
SMAC codebase for ARM7® and is supplied in an IAR Embedded Workbench for ARM project.
The source code exercises key features of the MC13224V and provides a good reference or
starting point for creating custom applications on the SMAC codebase. The application source
code includes the following features:
RF Evaluation
Range Test Application
Packet Error Rate Test (PERT) Application
Transmitting and receiving on the UART
Using low power modes
Reading and writing to Non-Volatile Memory (NVM)
Reading Analog to Digital Converters
Using GPIOs
1.2 REFERENCED DOCUMENTS
Table 1 contains the documents that have been referenced by this document (or recommended
as additional information). Please consult the appropriate website to check for the latest
revisions and editions.
Table 1 – Related and Referenced Documents
Document Title Document Name / Number
Freescale Semiconductor Documents
BeeKit™
BeeKit™
BeeKit™
MC13224V
MC1322x
MC1322x
MC1322x
802.15.4 Media Access Controller (MAC) MyWirelessApp 802154MWAUG
802.15.4 Media Access Controller (MAC MyStarNetworkApp 802154MSNAUG
802.15.4 MAC PHY Software Reference Manual 802154MPSRM
Simple Media Access Controller (SMAC) User’s Guide SMACRM
Several options exist to purchase or evaluate this program.
See
The included SMAC project on the CD was developed in IAR Embedded Workbench® for
Rev B 0006-00-08-02-000 Page 5 of 34
www.iar.com for details
ARM version 5.20.
2.1.2 J-Link
FreeStar Pro SMAC Programmers’ Guide
Figure 2 – Photo, J-Link Debugging Probe
The IAR J-Link is necessary for in-circuit debugging.
See
Download and install the latest driver from http://www.segger.com/download_jlink.html
www.iar.com for more details and where to purchase.
2.2 PROJECT OVERVIEW
2.2.1 File Location on the CD
A complete IAR project, developed based on the BeeKit™ SMAC codebase is included on the
CEL CD in the directory \ZFSM-201\Application Source Files\CEL_SMAC_111_v1.2
\CEL_SMAC_111\. It is titled ‘CEL_SMAC_111.eww’.
The project was based on the ‘Generic Application’ template in BeeKit™ (see Figure 3)
with changes to a few of the Application Source files.
2.2.2 Changes to BeeKit Generated Files
The default project creates one application source file named generic_app.c contained in the
subdirectory \ZFSM-201\Application Source Files\ CEL_SMAC_111_v1.2 \CEL_SMAC_111
\Application\Source. See Table 2.
Rev B 0006-00-08-02-000 Page 6 of 34
Figure 3 – Screen, BeeKit – New Project
FreeStar Pro SMAC Programmers’ Guide
Table 2 – Code, “generic_app.c” – “main” function
generic_app.c
/************************************************************************************
* main function
*
* Executes the main function.
*
************************************************************************************/
void Main(void)
{
MSG_INIT(TX_msg, &dataTX, NULL);
MSG_INIT(RX_msg, &dataRX, (callback_t)(application_rx_cb));
RX_msg.u8BufSize = APP_PACK_SZ;
Table 2, notice that the default contents of the ‘for’ loop are commented out and a function
named ‘MainState()’; is called instead. This makes porting the application code to new
codebases, or other projects quicker and cleaner.
Several files created by BeeKit™ had to be modified. They include changes to:
o project settings
o TransceiverConfigMngmnt.h file
o generic_app.c file
o UartUtil.c file
o WirelessLinkMngmt.c file
These changes are fully documented at the top of the ‘main_state.c’ file and are shown in
Table 3.
//////////////////////////////////////////////////////////////////////////////////
// Filename: main_state.c
//
// Description: this is the main state machine for the application
// it is kept in a different function than main() so that
// it is easier to keep the project in tact as new versions
// of the SMAC codebase are released. An attempt will be made
// in this file to document any changes to BeeKit generated
// code. This will again make it easier to keep the project in
Rev B 0006-00-08-02-000 Page 7 of 34
FreeStar Pro SMAC Programmers’ Guide
main_state.c
// tact as SMAC codebase updates come out.
//
// Include main_state.h in the BeeKit generated source file.
//
// This function needs to be called in the main() function of
// the BeeKit generated application source file.
//
// coding follows LSR Software Quality Standard - C Coding Standard
//
// Micro: Freescale MC1322x
// Compiler: IAR EWARM
//
// Written by: Christopher Hofmeister
//
// Copyright (c) 2008 LS Research, LLC
// www.lsr.com
//
// Version rev 1.0
//
//////////////////////////////////////////////////////////////////////////////////
// ****** Changes to BeeStack Generated Code ******
//project settings
// 1) in workspace window under Application->Utilities folder remove
// display.c and sound.c
//
//
//TransceiverConfigMngmnt.h (In workspace window in IAR under SMAC->Source)
// - find and replace:
// typedef enum Test_Mode_tag
// {
// SMAC_TEST_MODE_IDLE = 0,
// SMAC_TEST_MODE_CONTINUOUS_RX,//1
// SMAC_TEST_MODE_CONTINUOUS_TX_NOMOD,//2
// SMAC_TEST_MODE_CONTINUOUS_TX_MOD,//3
// SMAC_TEST_MODE_PULSE_PRBS9_TX,//4
// SMAC_TEST_MODE_PER_RX,//5
// SMAC_TEST_MODE_RANGE_RX,//6
// SMAC_TEST_MODE_PER_TX,//7
// SMAC_TEST_MODE_RANGE_TX,//8
// SMAC_MAX_TEST_MODES//9
// } Test_Mode_t;
//
//
//generic_app.c
// 1) find and comment out: print_freescale_logo(); (fucntion call only in static
// void generic_app_init(void)
//
// 2) the following keep the Switch ISR callback out the the generic_app code that
// is replaced with a new codebase
// -find: CRM_RegisterISR(gCrmKB4WuEvent_c, Switch_1_isr);
// change: CRM_RegisterISR(gCrmKB4WuEvent_c, Switch1_isr);
Rev B 0006-00-08-02-000 Page 8 of 34
FreeStar Pro SMAC Programmers’ Guide
main_state.c
//
// -find: CRM_RegisterISR(gCrmKB4WuEvent_c, Switch_2_isr);
// change: CRM_RegisterISR(gCrmKB4WuEvent_c, Switch2_isr);
//
// -find: CRM_RegisterISR(gCrmKB4WuEvent_c, Switch_3_isr);
// change: CRM_RegisterISR(gCrmKB4WuEvent_c, Switch3_isr);
//
// -find: CRM_RegisterISR(gCrmKB4WuEvent_c, Switch_4_isr);
// change: CRM_RegisterISR(gCrmKB4WuEvent_c, Switch4_isr);
//
// 3) find: #define APP_PACK_SZ (125) in generic_app.c and comment out
// ensure it is defined in application_globals.h
//
// 4) in list of include files add:
// #include "application_globals.h"
// #include "main_state.h"
//
// 5) in void main (); find and comment out:
// for(;;)
// {
// (void)process_radio_msg();
// data_indication_execute();
// process_uart_data();
// generic_app();
// }
//
//UartUtil.c
// 1) comment out: IntAssignHandler(gUart1Int_c, (IntHandlerFunc_t)UartIsr1);
// replace with: IntAssignHandler(gUart1Int_c, (IntHandlerFunc_t)UartIsr1A);
//
// 2) comment out: ITC_EnableInterrupt(gUart1Int_c);
// copy and move to bottom of UART1 init routine: ITC_EnableInterrupt(gUart1Int_c);
//
// 3) add extern void UartIsr1A(void); prototype
//
//WirelessLinkMngmt.c
// 1) find FuncReturn_t MCPSDataRequest (message_t *msg)
// add
// #if MANUAL_PA_POWER == TRUE
// LED_TurnOnLed(LED1);
// u16LED1_OnTimer = 10;
// #endif
//
// 2) add
// #include "../../Application/Utilities/Leds.h"
// #include "../../Application/Source/application_globals.h"
// extern uint16_t u16LED1_OnTimer;
//
//////////////////////////////////////////////////////////////////////////////////
Rev B 0006-00-08-02-000 Page 9 of 34
FreeStar Pro SMAC Programmers’ Guide
2.3 APPLICATION FILES
Figure 4 – Screen, IAR Workbench – Application Source and Utility Files
NOTE:
The screenshots used in this user guide may be based on a prior release of the corresponding Freescale
codebase, for version / project information with regards to the example included on the CEL CD, please refer to
Section 2.2. For the latest Freescale codebase, please download the Freescale BeeKit™ from the Freescale website.
2.3.1 Source Files
As shown in Figure 4, six application source files are included in the Sample Project. Except for
generic_app.c, each file also has a corresponding header (.h) file.
application_nvm.c Contains the source code necessary to write to NVM
applications.c Contains the base applications for the CEL/SMAC release
o range test
o packet error rate test
o continuous receive
o pseudo random binary sequence tx
generic_app.cSee description in Section 0 above
main_state.c See description in Table 3 above
timer.cEnables and processes timer related functions
uart_parse.c Handles incoming and outgoing UART messages.
2.3.2 Utility files
The following software modules included with the project when made by BeeKit™ are located in
the ‘Utilities’ folder as shown in Figure 4.
Keyboard.c Contains the keyboard initialization function
Leds.cContains utility functions for the LEDs management
UartUtil.cContains the UART utilities
Rev B 0006-00-08-02-000 Page 10 of 34
FreeStar Pro SMAC Programmers’ Guide
2.4 PLM AND SMAC SOURCE FILES
Additional source files are included in the project when made by BeeKit™ and stored in the
PLM and SMAC directories. They are shown in Figure 5 below.
Figure 5 – Screen, IAR Workbench – PLM and SMAC Source Files
2.5 DEBUG/RELEASE WORKSPACE MODE
During development it is strongly recommended that the ‘Workspace’ be kept in ‘Debug’ mode
as shown in Figure 6.
Figure 6 – Screen, IAR Workbench – Debug mode
Rev B 0006-00-08-02-000 Page 11 of 34
Loading...
+ 23 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.