1 / 22

The ZigBee Development Enviroment

Learn how to develop for ZigBee with the Freescale NSK and BeeStack. Get hands-on experience with actual hardware and discover the tools required for ZigBee development.

dianan
Download Presentation

The ZigBee Development Enviroment

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The ZigBee Development Enviroment Date: 2009/11/24 Speaker: Junn-Keh Yeh Advisor: Quincy Wu

  2. Outline • Introduction • Development hardware • Introduction to the Freescale NSK • The ZigBee stack • Introduction to Freescale BeeStack • Introduction to Freescale BeeKit

  3. Introduction • This chapter is for those who want to understand how to develop for ZigBee. • If you want to develop ZigBee-based products, or are new to embedded development, or if you want to follow along with the examples using actual hardware rather than simply reading about ZigBee, then this chapter contains what you need. • A story – Chapultepec(Nahuatl language)Zigibi

  4. Development hardware • The PC tools required for ZigBee development usually include: • An IDE.(Integrated Development Environment) • A ZigBee stack configuration or application “ template ” tool. • A debugger for downloading and stepping through source code lines on the target platform. • A protocol analyzer for debugging the network over-the-air.

  5. Development hardware(con.) • Hardware for ZigBee development kits usually include: • Two or more ZigBee boards. • A means of connecting target boards to the PC, usually through USB or Ethernet. • A JTAG (Joint Test Action Group) or BDM (Background Debug Monitor ) debug device for programming the flash memory in the target boards. • A sniffer for detecting over-the-air packets and delivering them to the protocol analyzer. • Power supplies and/or batteries for powering the boards.

  6. Development hardware(con.) • Nec • Oki • Freescale • Renesas/ZMD • Silicon Laboratories • ST Microelectronics • Texas Instruments/ChipCon • Airbee • Atmel • Ember • Freescale • Integration Associates • Jennic • MeshNetics • Microchip Golden Unit

  7. A Typical ZigBee System

  8. Introduction to the Freescale NSK • Each board hosts four application-driven buttons, a reset button, four LEDs, and a serial connection via the USB port. In addition, each board exposes the GPIOs(General Purpose I/O) available from the microcontroller, so that sensors and actuators can be added using a simple connector. • The smaller Sensor Remote Boards (SRB) also include a low-g 3-axis accelerometer and a temperature sensor, both of which will be used in examples later on in this book. • The larger Network Control Board (NCB) does not include sensors, but does include a 2-line by 16-column LCD display.

  9. Introduction to the Freescale NSK

  10. The ZigBee stack Figure: ZigBee diamond network

  11. The ZigBee stack • The multitasking kernel found with ZigBee implementations include multiple timers to allow applications to time various events, and for ZigBee to time random back-offs, retransmissions, acknowledged packets, and other networking operations. • The kernel also controls memory allocation for transmitted and received packets.

  12. The ZigBee stack Figure: ZigBee Implementations Include a Multitasking Kernel

  13. Introduction to Freescale BeeStack Each layer is connected through what is called a Service Access Point (SAP).

  14. AF-APS SAP handler typedef struct zbApsdeDataReq_tag { zbAddrMode_t dstAddrMode; /* indirect, group, direct-16, direct-64 */ zbApsAddr_t dstAddr; /* short address, long address or group (ignored on indirect mode) */ zbEndPoint_t dstEndPoint; /* destination endpoint (ignored if group mode) */ zbProfileId_t aProfileId; /* application profile (either private or public) */ zbClusterId_t aClusterId; /* cluster identifier */ zbEndPoint_t srcEndPoint; /* source endpoint */ uint8_t asduLength; /* length of payload */ uint8_t *pAsdu; /* pointer to payload */ zbApsTxOption_t txOptions; /* options on transmit */ uint8_t radiusCounter; /* # of hops */ } zbApsdeDataReq_t;

  15. Initializes the Application void BeeAppInit( void ) { index_t i; /* initialize LED driver */ LED_Init(); /* register to get keyboard input */ KBD_Init(BeeAppHandleKeys); /* initialize LCD (NCB only) */ LCD_Init(); /* initialize buzzer (NCB, SRB only) */ BuzzerInit(); BuzzerBeep(); /* register to get ZDP responses */ Zdp_AppRegisterCallBack(BeeAppZdpCallBack); /* flash LED1 to indicate not on network */ LED_TurnOffAllLeds(); LED_SetLed(LED1, gLedFlashing_c); /* indicate the app on the LCD */ LCD_WriteString(2, “ CustomApp ” );

  16. Initializes the Application(con.) /* register the application endpoint(s) */ for(i = 0; i < gNum_EndPoints_c; + + i) { (void)AF_RegisterEndPoint(endPointList[i].pEndpointDesc); } /* remember first endpoint */ appEndPoint = endPointList[0].pEndpointDesc- > pSimpleDesc- > endPoint; /* remember first cluster */ Copy2Bytes(appDataCluster, endPointList[0]. pEndpointDesc- > pSimpleDesc- > pAppInClusterList); /* allocate timers for use by this application */ appTimerId = TMR_AllocateTimer(); }

  17. LED Link Function void MyLedBlinkFunction(void) { /* flash LED4 for 3 seconds */ LED_SetLed(LED4, gLedFlashing_c); TMR_StartSingleShotTimer(appTimerId, 3000, MyTimerCallBack); } void MyTimerCallBack(tmrTimerID_t timerId) { (void)timerId; /* timer ID not used in this case */ LED_SetLed(LED4, gLedOff_c); }

  18. BeeStack Event Scheduler The multitasking environment in BeeStack is cooperative, not preemptive. That means if a single task (say the application) stays in a while() loop, no other task receives control until the BeeAppTask() function exits.

  19. Summarize BeeStack • Freescale BeeStack represents ZigBee as a set of separate tasks, mirroring the modules in the ZigBee architecture. • The BeeStack ZigBee modules (also called layers) communicate to each other through service access points. • Each task may receive callbacks for various physical events such as key presses, serial input, expired timers, and data indications. • Each task may also receive logical events, represented by a bit-mask of events passed to the task’s event function. Application events go to BeeAppTask(). • A common user interface is used for all demo applications.

  20. Introduction to Freescale BeeKit • BeeKit’s main features include: • A set of application templates • The ability to configure application and stack options through properties • An easy-to-use New Project Wizard • Full context-sensitive help for properties • The ability to easily upgrade to a new code base • BeeKit uses the following terms: solution, project, template, code base, and properties

  21. Introduction to Freescale BeeKit

  22. Thanks

More Related