Page 1
Free Star Pro Series ZFSM-201-EVB-1 Evaluation Board MAC Programmers’ Guide ZFSM-201-1 FreeStar Pro Module Document # 0006-00-08-05-000 (Rev B) ...
FreeStar Pro MAC Programmers’ Guide Table of Contents OVERVIEW ......................4 DESCRIPTION .................... 4 REFERENCED DOCUMENTS ..............4 CODE DEVELOPMENT IN IAR WORKBENCH® ..........5 TOOLS ......................5 2.1.1 IAR Embedded Workbench®...
Page 3
FreeStar Pro MAC Programmers’ Guide 3.5.5 Receiving a RF Message ..................... 19 STATE DIAGRAMS ................... 20 3.6.1 Main State Diagram ...................... 20 3.6.2 AppInit State Diagram ....................21 3.6.3 Transmit/Receive RF Message State Diagram ............22 ...
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®...
0006-00-08-05-000 ZFSM-201-KIT-1 Wireless UART Application User Guide 0006-00-08-06-000 ZFSM-201-KIT-1, ZFSM-201-EVB-1 Erratum 0006-00-08-04-000 Note: The CEL documents listed above are included on the CEL CD. 2 Code Development in IAR Workbench® Figure 1 – Screen, IAR Website, Workbench® TOOLS 2.1.1 IAR Embedded Workbench® for ARM Several options exist to purchase or evaluate this program.
File Location on the CD A complete IAR project, developed based on the BeeKit™ MAC codebase is included on the CEL CD in the directory \ZFSM-201\Application Source Files\CEL_MAC_111_v1.3 \CEL_MAC_111\. It is entitled ‘CEL_MAC_111.eww’. The project was based on the ‘MyWirelessApp Demo Framework’ template in BeeKit™ (see Figure 3).
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 Error! Reference source not found.. For the latest Freescale codebase, please download the Freescale BeeKit™...
FreeStar Pro MAC Programmers’ Guide application_mac.c - This code contains the base applications for the CEL/MAC release: Range test Packet error rate test Continuous receive Psuedo random binary sequency tx MApp_app.c - Main C file exported out of BeeKit.
FreeStar Pro MAC Programmers’ Guide PLM AND MAC SOURCE FILES Additional Source files are included in the project when made by BeeKit™ and stored in the PLM and MAC directories. They are shown in Figure 7 below. Figure 7 – Screen, IAR Workbench – PLM and MAC Source Files J-LINK SPEED Figure 8 –...
FreeStar Pro MAC Programmers’ Guide 2.6.1 Change the J-Link speed by following steps: Right-click on the project name. In Figure 8 above the project name is ‘CEL_MAC_101_DP’. Select ‘Options…’ from the Menu List. In the ‘J-Link/J-Trace’ category, set the ‘Reset’ to ‘Software’ and the ‘JTAG/SWD speed’...
FreeStar Pro MAC Programmers’ Guide MAIN IAR FEATURES 2.8.1 Building a Project Under the ‘Project’ menu several options exist to ‘Make’, ‘Compile’, or ‘Rebuild All’ code. Figure 11 – Screen, IAR Workbench – Project Menu 2.8.2 Downloading into Flash: Ensure J-Link is connected to PC though the USB cable.
FreeStar Pro MAC Programmers’ Guide Figure 12 – Screen, IAR Workbench – Download and Debug 3 MAC Development with Sample Application CODE DEVELOPMENT The MC13224V is a powerful ARM7 based processor integrated with an IEEE 802.15.4 radio. Although the Sample Project provided does not exercise every available feature and option, many software components for developing custom applications are included, such as: ...
FreeStar Pro MAC Programmers’ Guide Task Scheduler Information about the Task Scheduler can be found in the IEEE 802.15.4 Media Access Controller (MAC) MyWirelessApp User’s Guide. 3.2.1 Task Priority Tasks are run based on priority. The list of default tasks can be found in Application/Interface/Mac_Global.h file.
FreeStar Pro MAC Programmers’ Guide 3.2.3 Task Events Every task can have up to sixteen events in the form of a simple bitmask. The events are passed into the task. The main tasks in the sample project are defined in application_globals.h file.
FreeStar Pro MAC Programmers’ Guide Figure 19 – Starting a Single Shot Timer 3.3.3 Starting an Interval Timer Some timers can be setup to expire on a periodic basis. To accomplish this use the TMR_StartIntervalTimer() function. Its arguments are the same as those of a Single Shot Timer.
FreeStar Pro MAC Programmers’ Guide during initialization. Figure 21 – Changing RF Power 3.5.3 All other Network Parameters The IEEE 802.15.4 is rich with features and options. Additional Freescale documentation referenced in Error! Reference source not found. outline some of the IEEE 802.15.4 features.
Page 17
FreeStar Pro MAC Programmers’ Guide Figure 22 – Setting up other Network Parameters Rev B 0006-00-08-05-000 Page 17 of 33...
FreeStar Pro MAC Programmers’ Guide Figure 23 – Changing the PAN-ID 3.5.4 Sending a RF Message Once the network has been established (See 3.5.1) the device is ready to send a RF message. A function called AppTransmitPacket() is included in the application_mac.c file that will transmit a RF message and can also be seen in Figure 24.
FreeStar Pro MAC Programmers’ Guide Figure 25 – MCPS message sent confirmation 3.5.5 Receiving a RF Message Confirmation that the message has been sent will come from the MAC in the form of a MCPS message. The AppTask() function in main_app.c checks for messages from the MCPS, and will process accordingly.
FreeStar Pro MAC Programmers’ Guide STATE DIAGRAMS The following sections describe the states used in the Sample Project with the goal of helping the user to understand the code, and how to modify it for a custom application. 3.6.1 Main State Diagram Figure 27 –...
FreeStar Pro MAC Programmers’ Guide 3.6.3 Transmit/Receive RF Message State Diagram Figure 29 – Diagram, Transmit/Receive Message State Rev B 0006-00-08-05-000 Page 22 of 33...
FreeStar Pro MAC Programmers’ Guide 3.6.4 PERT Transmit Message State Diagram PERT Transmit INIT_PERT_TX State -Setup Radio -Setup PERT Message Done Transmitting TRANSMITTING_PERT State Message? All Messages Sent? DONE Figure 30 – Diagram, PERT Transmit Message State Rev B 0006-00-08-05-000 Page 23 of 33...
FreeStar Pro MAC Programmers’ Guide 3.6.5 Hibernate using 2kHz Oscillator State Diagram Figure 31 – Diagram, Hibernate using 2kHz Oscillator State Rev B 0006-00-08-05-000 Page 24 of 33...
FreeStar Pro MAC Programmers’ Guide 3.6.6 Hibernate using 32kHz Oscillator State Diagram Figure 32 – Diagram, Hibernate using 32kHz Oscillator State Rev B 0006-00-08-05-000 Page 25 of 33...
FreeStar Pro MAC Programmers’ Guide 3.6.7 Doze using 24MHz Reference Oscillator State Diagram Figure 33 – Diagram, Doze using 24MHz Oscillator State Rev B 0006-00-08-05-000 Page 26 of 33...
FreeStar Pro MAC Programmers’ Guide 3.6.8 Enable Buck Regulator State Figure 34 – Diagram, Enable Buck Regulator State Rev B 0006-00-08-05-000 Page 27 of 33...
FreeStar Pro MAC Programmers’ Guide 3.6.12 Reading ADC’s State Diagram Figure 38 – Diagram, Reading ADC’s State Rev B 0006-00-08-05-000 Page 31 of 33...
Other events can be easily added. 3.11 READING ADC’S Two A/D converters are connected to Potentiometers on the CEL ZFSM-201-EVB-1 FreeStar Pro Evaluation Board. Another A/D internal to the MC13224V can be used to monitor the battery voltage.
FreeStar Pro MAC Programmers’ Guide This ‘adjusted’ Power Supply Value can be used to improve the accuracy of the A/D values obtained from the power supply. o ADC Voltage = (A/D result /4095) * Power Supply Voltage 3.12 USER INPUTS (SWITCHES) ...
Need help?
Do you have a question about the ZFSM-201-EVB-1 and is the answer not in the manual?
Questions and answers