Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "The ZigBee Development Enviroment Date: 2009/11/24 Speaker: Junn-Keh Yeh Advisor: Quincy Wu."— 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 2009/11/242

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 2009/11/243

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. 2009/11/244

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. 2009/11/245

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

7 A Typical ZigBee System 2009/11/247

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. 2009/11/248

9 Introduction to the Freescale NSK 2009/11/249

10 The ZigBee stack 2009/11/2410 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. 2009/11/2411

12 The ZigBee stack 2009/11/2412 Figure: ZigBee Implementations Include a Multitasking Kernel

13 Introduction to Freescale BeeStack 2009/11/2413 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; 2009/11/2414

15 Initializes the Application 2009/11/2415 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.) 2009/11/2416 /* register the application endpoint(s) */ for(i = 0; i < gNum_EndPoints_c; + + i) { (void)AF_RegisterEndPoint(endPointList[i].pEndpoint Desc); } /* 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 2009/11/2417 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 2009/11/2418 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. 2009/11/2419

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 2009/11/2420

21 Introduction to Freescale BeeKit 2009/11/2421

22 Thanks 2009/11/2422


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

Similar presentations


Ads by Google