Applikationsnoten
Jennic : JN5121-EK010 – Getting Started
Von: Jennic1. Introduction
This document describes the basics of working with JN5121-EK010 – ZigBee Evaluation Kit. More particularly “JN5121-EK010 – Getting Started” Application Note introduces the system functionality, preinstalled software and the most important concepts for user’s application development. IEEE 802.15.4 and Zigbee basics are included to provide fundamental understanding of the system which is an object of the further development.
1.1 Hardware contents
JN5121-EK010 ZigBee Evaluation Kit is shipped as fully functional system allowing the users to build ZigBee sensor networks. The package consists of one controller board and four sensor boards. Each board is equipped with an integrated antenna solution and a number of sensors that are responsible for measuring temperature, humidity and light levels. The controller board which features the LCD panel and external powering system input is prepared to take permanent responsibility for coordination of the wireless network and thus it will be normally used as Co-ordinator – the network coordination device in terminology of the ZigBee specification. The sensor boards normally will act in the network as Routers which are responsible for routing messages between End Devices that participate in the ZigBee network but are neither Zigbee Router and Co-ordinator. Using Co-ordinator and a number of Routers (and optionally End Devices) it is possible to build fully functional ZigBee mesh network. It is the network in which data are routed between nodes through continuous connections which can be automatically reconfigured to bypass blocked paths by sending data form node to node till the destination is reached. The package additionally includes two serial converters necessary to convert RS232 voltage level to LVTTL level and one serial cable equipped with male and female DE-9 connector.
1.2 Software contents
Software for JN5121-EK010 in most cases should be downloaded from Jennic’s support web portal (http://www.jennic.com/support/index.php) because of continuous evolution. The only exception could be a CD (optionally supplied by vendor) containing a trial version of Sensor Network Analyzer tool developed by Daintree Networks. Usually users will be interested in downloading Software Development Kit (SDK) that will allow creating firmware with use of appropriate Application Programming Interface (API). On Jennic’s support web portal it is possible to find and download (even without registration) Integrated Development Environment (including SDK) based on Code::Blocks platforrm. Apart from software development tools, Jennic offers also free of charge, sample applications, presenting the proper use of APIs. These are fully functional applications that can be built under toolchain and programmed directly into the FLASH memory of the wireless module. JN5121-EK010 ZigBee Evaluation Kit is shipped with installed firmware stored in Flash Memory. Preinstalled firmware allows the user to realize ZigBee home sensor network. The demonstration application is provided to give an example of software that is built on the top of ZigBee stack. In this example application, controller board is used as Co-ordinator and sensor boards are functioning as Routers and End Devices. Routers and End Devices measure temperature, humidity and light level and send this data periodically to the Coordinator which displays received measurements on the LCD panel.
1.3 Development System
Users that are working with JN5121-EK010 must provide development system. Development system should consist of PC with Windows XP OS equipped with serial communication port. A serial port is necessary to obtain connection with the serial converter which is needed for writing the user’s firmware into the FLASH memory. Serial converter can be also used to provide serial communication between EVK board and terminal application in case of simulating the UART communication between EVK board (with appropriate firmware) and other microprocessor solution. It is possible to use simple terminal application like Terminal (http://www.hw-server.com/software/termv19b.html) for that purpose. The SDK which should be installed on the development system is equipped with GUI Flash Programmer which with the conjunction with serial converter will allow changing the content of FLASH memory.
2. IEEE 802.15.4
IEEE 802.15.4 refers to the IEEE standard specifying low data rate Wireless Personal Area Network (WPAN). The standard specifies two layers – Physical (PHY) and Medium Access Control (MAC). Standard ensures the wireless transmission with low data rate (250kbps) operating in the industrial, scientific and medical (ISM) radio bands. Although the standard details three different PHY layers (868MHz, 915MHz and 2450MHz band), 2.4GHz is the only band supported by Jennic’s products.
2.1 Jen-NET and ZigBee
Jen-NET and Zigbee are the names of high level network communication protocols for digital radios based on IEEE 802.15.4 standard. These protocols are designed for defining and managing general purpose networks for embedded applications which require low data rate and low power consumption. Jennic has developed Jen-NET and Zigbee 2004 protocol stacks. Jen-NET is Jennic’s 802.15.4 based stack supporting point to point, star and tree networks. Jennic Zigbee2004 (ZigBee Compliant Platform) is intended for mesh networks. These are the networks in which data are routed between nodes through continuous connections that can be automatically reconfigured to bypass blocked paths by sending data form node to node till the destination is reached. Although ZigBee 2004 stack can be considered as more or less obsolete at the moment, it is sufficient for most applications supporting up to 250 nodes. Jennic ZigBee 2007Pro stack should release on the fourth quarter of 2007. It is quite important to note that it won’t be interoperable with ZigBee2004 Stack.
3. ZigBee applications development
A typical embedded application intended to work in WPAN usually contains the implementation of user defined tasks (like sensor data acquisition and processing for nodes) and implementation of network protocol stack. In case when more than one task will need to use microcontroller resources at the same time it is essential to provide the task scheduler. To ensure sharing the control over microcontroller between user specific functions and protocol stack, Basic Operating System (BOS) was developed by Jennic. Therefore each ZigBee developer is responsible for starting ZigBee stack and BOS with use of appropriate API functions and later on running system specific functions. All APIs required for initializing and management of Zigbee stack and BOS are provided as part of Jennic's Software Developer Kit (SDK).
3.1 Application Programming Interfaces
Development of firmware designed for ZigBee network nodes can be easily achieved thanks to the following APIs. For more detailed information about Application Programming Interfaces please refer to the API documentation available on the Jennis’s support web portal.
- Application Development API
The functions defined in Application Development API are responsible for providing the means for interaction between user application and ZigBee stack software which is transparent for the developer. More particular Application Development API is responsible for ZigBee stack initialization for each ZigBee node (Co-ordinator, Router or End Device). This API defines the main entry points from boot loader. Each developer must define the following functions: PUBLIC void AppColdStart(void) and PUBLIC void AppWarmStart(void) in order to initialize ZigBee device. Below is presented the basic example of ZigBee node initialization.
PUBLIC void AppColdStart(void) {
/* Set up for network information */
JZS_sConfig.u32Channel = WSN_CHANNEL;
JZS_sConfig.u16PanId = WSN_PAN_ID;
/* General initialization */
vInit();
}
PUBLIC void AppWarmStart(void)
{
AppColdStart();
}
- Application Framework API
The Application Framework API defines functions and data structures allowing the user to interact with the application framework which can be simply defined as a standard structure of application for Jennic ZigBee applications. This API is responsible for management of data frames and device descriptors.
- ZigBee Device Profile API
ZigBee Device Profile API interacts with the remote ZigBee node Application Layer. It is used in order to identify other devices (Co-ordinator, Router or End Device) and to achieve the access to the services provided by them.
- Basic Operating System API
Basic Operating System API is used to perform task management (i.e. through registering the task with the BOS), handling the messages and events (sent between application and BOS), memory management (i.e. for dynamic memory allocation), interrupts handling (i.e. enabling interrupts) and error handling. As already mentioned in the introduction section of this paragraph, software developer is responsible for starting ZigBee stack and BOS. Initialization takes place in PUBLIC void AppColdStart(void) and/or PUBLIC void AppWarmStart(void) functions as follows:
PRIVATE void vInit(void)
{
/* Initialize Zigbee stack */
JZS_u32InitSystem(TRUE);
/* Initialize serial interface*/
vUART_Init();
/* Start BOS */
(void)bBosRun(TRUE);
}
- Integrated Peripherals API
Each JN5121 or JN5139 chip provides transceiver and microcontroller features. Microcontroller can be characterized as 32-bit RISC equipped with the number of peripherals such as 4 input 12-bit ADC, two 11-bit DACs, temperature sensor, two timer/counters, two 2 UARTs, SPI Port, 2 wire serial interface and GPIOs. The Integrated Peripheral API defines functions that allow using these peripherals without need of accessing registers by the software developer.
- AES Coprocessor API
Wireless transceiver of either JN5121 or JN5139 is equipped with security coprocessor (128-bit AES). The AES Coprocessor API defines functions that allow using security engine without need of accessing registers by the software developer.
- Board API
Board API provides the means for interacting with the Jennic's evaluation board components allowing the user to interact with LEDs, LCD panel and temperature, humidity or light sensors through using simple functions instead of directly accessing the registers.
3.2 Sample application development
In order to test the functionality of JN5121-EK010, the Wireless Sensor Network (WSN) sample application was used and modified. The original version of WSN application can be downloaded from Jennic’s support web portal. WSN application is an implementation of Co-ordinator and Router nodes software based on Jennic's Zigbee stack. The Co-ordinator is responsible for receiving data from nodes via the ether and retransmitting it to the PC via serial connection. This application can be easily modified to achieve quasi AT commands interface available through UART. That kind of interface could significantly improve the complexity of the system allowing use of simple communication interface with a separate MCU (for example). AT commands communication could be used for starting and configuring the network. At the moment serial AT-type command set is not available for Jennic's products. It is quite relevant to notice that AT-Jenie solution should release on the fourth quarter of 2007.
3.3 Main application functions
After switching on the board the AppColdStart function is run as a boot loader entry point. This function is intended for system initialization and it is possible to call in this function user defined initialization procedures like i.e. starting up the UART or LED control system. Usually the most important ZigBee system parameters are set in this function. In the example of system initialization presented in 3.1 paragraph radio channel and PAN ID were set. That is also the place to initialize Zigbee stack and finally start BOS. After starting Basic Operating System JZA_vAppDefineTasks function is called by the BOS in order to allow the application to initialize (register within BOS) any tasks that it requires. In next step after running some internal and transparent for the user procedures JZA_boAppStart function is called by the BOS. It is the function which is responsible for setting up the profile information and starting up the network activity. In this function Zigbee Stack must be started within JZS_vStartStack before returning to the BOS. After starting up the ZigBee protocol stack, BOS is always calling one of the following functions: JZA_vAppEventHandler, JZA_vStackEvent, JZA_bAfKvpObject, JZA_vPeripheralEvent, JZA_bAfMsgObject, JZA_vAfKvpResponse, JZA_vZdpResponse allowing the user to get control from the level of user's application. To find detailed information about the functions listed above please refer to the ZigBee Stack User Guide available on the Jennic's support web portal. The flow diagram of a generic application is also available in this document.
3.4 Building project
In order to build the WSN application user must ensure that project files are located in separate folder under the following directory:
C:JenniccygwinjennicSDKApplication
The project files are available for each chip model (JN5121 or JN5139) and device type (Co-ordinator and Router). In case of JN5121-EK010 Evaluation Kit that will be:
JN5121_WSN_Coordinator.cbp
JN5121_WSN_Router.cbp
Building software for selected node type (under Code::Blocks IDE) should be started from opening the appropriate project file (i.e. JN5121_WSN_Coordinator.cbp). Then the user can modify the code and compile it using Build command from Build menu. After completing that process, the build log is available for the user in the bottom side of the IDE window. After compiling the project files intended for each node type, binary files (JN5121_WSN_Coordinator.bin and JN5121_WSN_Router.bin) will be available under the following directory:
C:JenniccygwinjennicSDKApplicationJN-AP-1015-Zigbee-Wirele
ss-Sensor-NetworkJN5121_BuildRelease
The most convenient way to download the .bin files into the FLASH memory is to use the GUI Flash Programmer application available under Tools menu of the Code::Blocks IDE. It is an intuitive tool that should be used with the conjunction with serial converter connected to the intended board. It is quite important to note that Flash Programmer after starting up will automatically set RTS line for default COM port. In case when user will change serial port than it is necessary to use Refresh command and reset the JN5121 board in order to set it into the programming mode.
Copyright
Reproduction of this material without written permission of Scantec GmbH is strictly prohibited.
Disclaimer
Scantec GmbH makes no warranty about the suitability or accuracy of the information contained in this document. All the information presented in this document is only for general information purposes.
Trademarks
ZigBee is a trademark of the ZigBee Alliance.
Quelle
Scantec GmbH - www.scantec.de
...more about Jennic
- Dateien:
sca_Application_Note_JN5121_EK010.pdf144 K






