Home
User`s Manual 8-bit MCU Release-it! Demo Kit
Contents
1. nnn nnns nnn 76 Figure 38 ID78KO TK configuration uu u u u u 2 77 UM U17587EE1VOUMOO 13 List of Tables Memory TaD TT m m 30 Table Position Table siio eect cto era elena 47 Table sS 55 Table 4 MEMESSAF 7 uuu u ete s maya aap us 55 Table 5 NEC 78K0 MAC software limitations bugs known 56 Table 6 MAC PIB attributes 69 14 UM U17587EE1V0UM00 1 INTRODUCTION The IEEE 802 15 4 wireless networking standard has been developed to allow for the implementation of Low Rate Wireless Personal Area Networks LR WPAN LR WPAN is a simple low cost communication network that allows wireless connectivity in applications with limited power and relaxed throughput requirements The main objectives of an LR WPAN are ease of installation reliable data transfer short range operation extremely low cost and a reasonable battery life while maintaining a simple and flexible protocol Some of the characteristics of an LR WPAN are e Over the air data rates of 250 kb s 40 kb s and 20 kb s e Star or peer to peer operation e Allocated 1
2. 65 6 4 16 MEME SOADNJASIGGUGSE 65 6 4 17 MLME SCAN 5 66 6 4 19 MLME SET Req est 67 6419 MEMERS TART REGUCSE u uuu 67 0 4 20 MEME SYNG ROSSI or 68 6 4 21 MEME SYNG LOSS ANGICATON eies rb rens EIE ka S e codd 68 6 4 22 MEME POLL BegUGBSLlis u Su 68 6423 MLEME POLLSCOBPETI u ciet ulus ear 68 6 9 MAG PIB uu ae 69 7 APPENDIX NEC DEBUGGER INSTALLATION AND 74 12 UM U17587EE1VOUMOO List of Figures otar uuu shared TT 16 Figure 2 6er to Peer Topology simi iinet el een 17 Figures Gl ster Tree 17 Figure 4 IEEE 802 14 5 working model
3. 20 10 51 8 eec cc 21 CHAPTER 2 LIBRARY INSTALLATION AND USE J T T J J 22 21 Hardware A 22 2 2 LID rary u u ku u puas Gu uuu 22 2 3 Systems Embedded Workbench for 78 5 installation 23 2 u ierra ds i ee Sape E tes 24 2 5 WS tallaulOn S eee 25 2 5 1 Linking library to the 25 2 5 2 Provide Header files path 26 2 5 3 Stack and Heap size 27 Byte alignrmmenbdalg io ce 28 25 5 u aree iyun eaves m 29 2 uy UT D ULT 31 2 5 7 LOW level hardware initialisation u uuu uu u u u L u mini ua R eee 31 IMAI CIOCK OSCI u t cT 31 2 Of ee Mateldog u ec 31 2 5 7 9 ARAM mermoby Initallsatioli
4. ust Eee d 52 46 5 78K Sampa uuu m a bete esse 53 4 6 7 Application Declaration header 1 53 CHAPTERS MAC LAYER OVERVIEW iu u u uu ve n Eu eo aaa 54 5 1 MAC SUDI YEV uu u Sy ss CO ES ER ua Oe SR du e LE Ce esc 54 5 2 MAC sublayer S rvice Specification o ceci ree roux RO He oo vr verc Edu dee au Vus Ces du Qui eO aU E eee 54 5 9 NE DE en 55 54 MAC management Service 5 sS EI pex m uu NA EI S 55 55 Software limitations and Bugs i 56 CHAPTER6 APPLICATION PROGRAMMING INTERFACE FOR RELEASE IT PLATFORM 58 sese c P 59 62 lt a 59 6 2 MEE Licet ENTE EE 59 62 2 CONI 59 6 O dian eet rr 59 lt lt E uude 59 5 2 MGPS SADB aaa ua ie et kta E EI 60 6 32 IMIGPS DATA REGUS Rt E Geeta ER 60 opp Me do BYE NOT UMEN EE 60 6 9 9 DATA 1880638000 uum un umu rode Pic Sosa 60 6 94 MOPS DATA PUO
5. en Dac 32 2 5 7 4 low level init PrOCedure a 32 29 8 Address AllOCallONS acce umu eee eee 32 20 81 MAG AQ GSS Tun uma u 32 2 5 8 2 Attributes and local address 33 2 5 8 3 Initialisation of the 34 26 Library PUNGCUIONS ki i eoi te ee veta oer veo serae eee weer everett ieee ceed 35 2 64 Funetlons deriried by the lIDFarles o ea Moe Dee x Le t ale 35 2 5 2 Contr and Indican TUNCUONS naa 36 2 e tesa euet Loc n apa au 36 SAMPLE PROJECT INSTALLATION 37 3 4 General Intoductioh o oe i t c lee 37 Siz Project directory te 37 2 3 Project USE cess 38 34 Eibrary eec 40 22421 40 22422 DESTINEO SVIMDOIS uu u 40 3248 5
6. eee eee ene es 41 Load RR 41 9 4 5 2 SCG uu u a ee eli ee iE 43 10 UM U17587EE1VOUMOO CHAPTER4 APPLICATION DESCRIPTIONS AND 45 41 LED pattern transmissi uuu kk u 45 42 Serial data transmission uuu u u den u aqusapa ushaq 45 InitialiSallOD oen iuuyyy e rece vai Deve Leere niv e ute e 45 CR MES uoce uyu cT 46 A352 Greene temer 46 AA RUN 46 Et meee 46 A242 aet naa tus 49 45 Applicaton Owca ys kau 50 4 5 u u Z TERES CIS NIU EE eH MINNS MEDI MP MDC 52 A o MEM ES TIEREN 52 MM Rm hoe 52 4 60 Md AD 52 CONTEE D S t otia eae 52 4 6 5 VARI TESESRSSIORI y u u uu l u
7. 19 Figure 5 Frames Str assibus us 19 Figure 6 Superframe structure with GTSS T nnns naar nnns 20 Figure 7 23 4 Ghz global SM DANO upper inten 20 Foure 9 co due 21 r Os aet anion datus m Fond d 23 Fiaure T10 TAR BFOISCUSITUGIUEO epe reduc 25 Figure 11 Include path project option 26 Figure 12 Stack size a eR ee 27 Figure 13 HEADSIZE project OOH Os usc aote morie 27 Figure 14 Byte Alignment Option nennen nnn nenne sss naa nnn rrr nnn an 28 Figure 15 Linker Tile proJect ODOM u eee AS 29 Figure 16 Debugger project a a aa 31 Figure 17 Library initialisation flowchart 34 Figure 18 Sample IAR project directory 38 Figure 19 Sample proj
8. Emulator 78 Simulator IEC ABE MIC SK Use macro file Device descriptions Use device description file DIR s 0EVICE FILESddfsio 48h ddf Cancel Figure 16 Debugger project option 2 5 7 Low level hardware initialisation This following part deals with the 78KO micro initialisation that must be done for library use It could be placed at the start of the main function or be the task of a Low Level Init routine 2 5 7 1 Main clock oscillator The application has to be set to run with a 16MHz main oscillator to match the library requirements 2 5 2 Watchdog Timer The watchdog timer has to be handled by the application layer and be set in order to allow the MAC stack to manage the wireless transmission The MAC stack requires a watchdog timeout of at least 1s to run without issue For application development it is easier to disable the watchdog UM U17587EE1V0UM00 31 CHAPTER 2 LIBRARY INSTALLATION AND USE 2 5 7 3 memory Initialisation The IXRAM memory segment has to be initialised This memory area is not initialised by the C start up and should be done in the low level initialisation 2 5 7 4 low level init procedure The sample program for the Release It kit does not use the standard Low Level Init library routine and defines its own to do the above task Creating a function with the prototype int low level init void allows the compiler
9. Enn label program star C Defined by application Search one per DIRSSLIB Figure 15 Linker file project option UM U17587EE1VOUMOO 29 CHAPTER 2 LIBRARY INSTALLATION AND USE Memory map The above linker file is specified for the Release It kit The MACADDRESS heap and stack segments are defined by this file Table 1 Memory map INTVEC ABS seco m Ws 8 _ SDD mr S NERN sanz FE 8 _ waesa 10202 o O SADDR A ABS NEAR_A ABS FFD library NEC 28 057 bytes of CODE memory 18 absolute 1 798 bytes of DATA memory 62 absolute RFD library NEC 19 340 bytes of CODE memory 18 absolute 1 793 bytes of DATA memory 62 absolute 30 UM U17587EE1V0UM00 CHAPTER 2 LIBRARY INSTALLATION AND USE 2 5 6 Debugger setting To debug the application make sure to set the workbench according to the device used The appropriate device file for Release It is io 8f0148h ddf It is the standard file provided with the IAR Embedded Workbench A copy of this file is provided in the directory Device File supplied with the Relesed It kit Options for node Zigbee FFD Release n Category Factory Settings General Uptions C C compiler Setup Plugins Assembler Custom Build Driver Linker Ima i z Aun to main Setup macros
10. Header Header MAC Payload Figure 5 Frame Structure The data frame provides a payload of up to 102 bytes The frame is numbered to ensure that all packets are tracked A frame check sequence ensures that packets are received without error This frame structure improves reliability in difficult conditions Another important structure for 802 15 4 is the acknowledgment ACK frame It provides feedback from the receiver to the sender confirming that the packet was received without error The device takes advantage of specified quiet time between frames to send a short packet immediately after the data packet transmission A MAC command frame provides the mechanism for remote control and configuration of client nodes A centralized network manager uses MAC to configure individual clients command frames no matter how large the network Finally the beacon frame wakes up client devices which listen for their address and go back to sleep if they don t receive it Beacons are important for mesh and cluster tree networks to keep all the nodes UM U17587EE1V0UM00 19 CHAPTER1 INTRODUCTION synchronized without requiring those nodes to consume precious battery energy by listening for long periods of time 1 5 Modes of operation There are 2 basic modes of operation for 802 15 4 networks they are Beacon Mode and Non Beacon Mode 1 5 1 Beacon Mode In Beacon mode a coordinator will transmit a beacon at pre determined intervals the i
11. The libraries required the setting of the byte alignment data at the time of linking for correct use of the C structures In the window Project Option C Compiler Code select the Byte Alignment Data option Options for node 78K 0 Release General Options L compiler Assembler Custom Build Linker Debugger IE z8 IECLIBE MINICUBE Lomrmorn subexpression elimination simulator Loap unrolling Function inlining Iw motion T pe based alias analysis Figure 14 Byte Alignment Option 28 UM U17587EE1VOUMOO CHAPTER 2 LIBRARY INSTALLATION AND USE 2 5 5 Add the linker file Set the correct linker file in the project option window The linker file to use is provided with the sample project It is a specified file called DF0148H V4 ZB XCL It is a specific file for using with the libraries Some modifications have been done to match the MAC stack requirement as new memory segment definitions or memory locations Therefore do not use a standard linker file with these libraries Options for node Zigbee FFD Release Factor Settings General Uptions C C compiler Output Extra define Diagnostics List Contig Processing Assembler Custam Build Linker command file Override default Debugger PR DJ DIES ALIN ER FILESOFOT48H 4 Emulator 1E 8 Simulator IEC ABE MICTBK Override default program entry
12. security feature is supported by the libraries DestinationAdd Short DEST SHORT Minimum PIB PAN Information Base attributes that have to be set SHORT ADDRESS MAC RX ON WHEN IDLE MAC ASSOCIATION PERMIT MAC PAN ID MAC SECURITY MODE MAC BEACON ORDER MAC SUPERFRAME ORDER The attributes are set and can be read using the following library functions Update PIB attributes mimeSetRequest Attribute Pointer data Check PIB attributes retval mimeGetRequest Attribute Pointer on test data For further details how to set the PIBs refer to the sample project and application code supplied with the Release It kit UM U17587EE1VOUMOO 33 CHAPTER 2 LIBRARY INSTALLATION AND USE 2 5 8 3 Initialisation of the libraries The recommended initialisation of the libraries is shown by the following flowchart Wait for main oscillator to stabilise Set the speed of the main clock to 16 Mhz Low level hardware initialisation Initialisation of the IXRAM Set the watchdog timer Initialisation of the MAC stack library Call the library s function Mac 78 init Setup development board peripherals Read MAC address from FLASH and write in RAM variable Reset the MAC layer Call the library s function MAC Library mlmeResetRequest initialisation Modify PIB attributes Flush the TX FIFO and Reset the Rx state machine and variable call library s function Flush TX RX Fifo Confirm test Enable the receiver Call th
13. uuu mua saa SaaS 61 0A u 61 6 41 MEME ASSOGIATE RGeGUGOSLI 61 6 42 MEME ASSOGIATE mo oue po deze de euo Der e oes Sh 62 6 4 3 55 62 644 CONDIT 62 6 4 5 5 63 6 4 6 MLME DISASSOCIATE Indication 63 64 7 MEME BISASSOGIATEGODIC Su uuu u u 63 648 MLME BEAGON NOTIFY aa a ms Qulu aqa 64 6 49 GET PBOSgpesSbuu mans LU Gu uuu au 64 ERE TT 64 64 11 IMEME ORPHANGEINGICA ON ees msn lE etae 64 64 12 MEME ORPHAN RESDONSC iis cto etn eto a erect oe 64 UM U17587EE1VOUMOO 11 uices c ttu LEE 65 6 4 14 MLME RX ENABUEAREGUCS 65 64 15
14. as defined above 02 11 1 UM U17587EE1VOUMOO 3 Regional Information come information contained in this document may vary from country to country Before using any product in your application please contact the office in your country to obtain a list of authorized representatives and distributors They will verity Device availability Ordering information Product release schedule Availability of related technical literature Development environment specifications for example specifications for third party tools components host computers power plugs AC supply voltages and so forth Network requirements In addition trademarks registered trademarks export restrictions and other legal issues may also vary from country to country NEC Electronics America Inc santa Clara California 408 588 6000 600 366 0782 Fax 408 588 6730 BO0 729 9288 NEC Electronics Europe GmbH Duesseldorf Germany Te O21 1 65 089 227 Sucursal en Espana Madrid Spain 091 504 27 87 Fax 091 504 28 60 Succursale Francaise V lizy Villacoublay France Tel 55 00 Fax 01 30 67 58 99 Filiale Italiana Milano 02 66 75 41 Fax 02 66 75 42 99 Branch The Netherlands Eindhoven The Netherlands 040 244 58 45 Fax 040 944 45 80 Branch Sweden Tasby Sweden 08 83 80 820 Fax 08 63 80 388 United Kingdom Bran
15. File ddf Bo Projects Er FFD Project EL 12 Release IAR_Projects folder Contains the projects 72272 files for the IAR Systems Embedded d P List Workbench 78K0 KOS obj It contains the IAR workspace and two sub NE settings folders for two projects FFD and RFD Br 3 RFD Project Both projects are based on the same EE E T application but use the appropriate library EER NC settings T settings Er Ca Libraries 0 1 FFD Libraries folder Contains the library object ME Header Files files tor FFD and RFD and the header files RED required for the library use Be Linker File Linker_File folder Contains the linker file Low Level Init folder Contains the low level init C source code Figure 18 Sample IAR project directory structure All the application source C files are located in the directory 78K0 SampleMApplication DemoSample Source and the application header files in the directory MAC 78K0 Sample Application DemoSampleWMnclude The library object files for FFD and RFD are respectively located in 78K0 SampleWMLibrariesFFD and MAC 78K0 SampleWibrariesRFD The library header files are located in the directory 78 0 SampleWMibraries Header File The libraries use the modified DF0148H V4 ZB xcl linker file which is located in the directory MAC 78 SampleWinker File The simulator t
16. PAN association and disassociation Supporting device security Employing the CSMA CA mechanism for channel access Handling and maintaining the GTS mechanism Providing a reliable link between two peer MAC entities 5 2 MAC sublayer service specification The MAC sublayer provides an interface between the SSCS and the PHY The MAC sublayer conceptually includes a management entity called the MLME This entity provides the service interfaces through which layer management functions may be invoked The MLME is also responsible for maintaining a database of managed objects pertaining to the MAC sublayer This database is referred to as the MAC sublayer PIB MCPS SAP MLME SAP MLME PLME SAP Figure 31 MAC sublayer model MAC Common Part Sublayer The MAC sublayer provides two services accessed through two SAPs service access point e The MAC data service accessed through the MAC common part sublayer MCPS data SAP MCPS SAP and e The MAC management service accessed through the MLME SAP These two services provide the interface between the SSCS and the PHY via the PD SAP and PLME SAP interfaces see 6 2 In addition to these external interfaces an implicit interface also exists between the MLME and the MCPS that allows the MLME to use the MAC data service 54 UM U17587EE1VOUMOO CHAPTER5 MAC LAYER OVERVIEW 5 3 MAC data service The MCPS SAP supports the transport of SSCS prot
17. SPY specific extra output file Other _ format fintelextended Format variant Segmented variant Module local symbols Include all j Figure 23 Debug output project option UM U17587EE1VOUMOO 43 CHAPTER3 SAMPLE PROJECT INSTALLATION 44 Options for node Zigbee FFD Release E General Options compiler Assembler Custom Build pe MNEUE 2005 Debugger IE 78 IECLIBE MINILLIBE Simulator FILE Sdadfso 48h ddf m Figure 24 On Chip Debugger project option UM U17587EE1VOUMOO CHAPTER 4 APPLICATION DESCRIPTIONS AND OPERATIONS 4 1 LED pattern transmission Provided as peripheral hardware on each of the boards is a joystick which is available to the user for application purposes This hardware is interfaced to the board via standard I O pins and with the creation of application software it is possible to monitor the inputs on these pins and therefore determine the position of the joystick each time it is moved With this information this application then utilises the LED provided on the board LED 1 2 3 to display a on off pattern representing the joystick position Each joystick position produces a different LED pattern Once a pattern for the LEDs has been selected the board can then transmit this pattern to the other board in the network This will synchronise the two boards and they will both display the same pattern until another pattern i
18. and the specified device The actual ACL is stored in the higher layer The MAC only stores the ACL entry set pointer 0x71 ACL ENTRY DESCHRIPTOR SET BYTE 0 00 The number of entries in the SIZE Oxff ACL descriptor set 0x72 MAC DEFAULT SECURITY BOOL TRUE Indication of whether the or device is able to transmit FALSE secure frames to or accept secure frames from devices that are not explicitly listed in the ACL It is also used to communicate with multiple devices at once A value of TRUE indicates that such transmissions are permitted security material used if 0x75 DEFAULT SECURITY SUITE BYTE 0x00 The unique identifier of the 0x07 security suite to be used to protect communications between the MAC and devices not in the ACL as specified in 0x73 MAC_DEFAULT_SECURITY_MATERIAL BYTE 0x00 _LENGTH DEFAULT MAC SECURITY MODE BYTE The identifier of the security 0x74 MAC DEFAULT SECURITY MATERIAL SECU Pointer A pointer to the default SECURITY is set to TRUE 72 UM U17587EE1VOUMOO CHAPTER6 APPLICATION PROGRAMMING INTERFACE FOR RELEASE IT PLATFORM mode in use 0x00 Unsecured mode 0x01 ACL mode 0x02 Secured mode UM U17587EE1VOUMOO 73 CHAPTER 7 APPENDIX NEC DEBUGGER INSTALLATION AND USE The uPD78K0148H CPU inclides On Chip Debugger features and supports basic debug function run break step memory access Th
19. e Cannot become a network coordinator e Talks only to a network coordinator e Very simple implementation An IEEE 802 15 4 ZigBee network requires at least one full function device as a network coordinator but endpoint devices may be reduced functionality devices to reduce system cost All devices must have 64 bit IEEE addresses Short 16 bit addresses can be allocated to reduce packet size Addressing modes e Network and device identifier star e Source destination identifier peer peer 1 3 MAC and PHY Layers The IEEE 802 15 4 standard specifically details the implementation of the PHY Physical layer and the MAC Media Access Control layer The simplified structure of this is shown below Upper Layers Software supplied by NEC Electronics 18 UM U17587EE1V0UM00 CHAPTER1 INTRODUCTION Figure 4 IEEE 802 14 5 working model The SW supplied in the NEC starter kit implements the 2400 Mhz 2 4 GHz PHY layer and MAC layer only 1 4 Frame Structure Below is illustrated the four basic frame types supported by IEEE 802 15 4 127 Bytes Maximum 2 1 0 20 Variable 2 Frame Sequence Address Data Control Number Info Payload Check Data Frame Sequence Frame Control Number Check Frame Sequence Address Command Frame Control Number Info Type Payload Check MAC Frames Command Frame Sequence Address Beacon Frame Control Number Info Payload Check Synchronisation
20. effective attention on Timing engines Interrupt handling Processing power available for the higher layers The limitations and bugs known on this revision of the MAC layer software are listed in the table 4 Any bugs updates requests should be reported to NEC Electronics Table 5 NEC 78 0 MAC software limitations bugs known Power optimisation Not fully implemented Dynamic CCA level Mot implemented The level definition when the channel is clear is currently static Acknowledge frame timing Timing acknowledge frames in beacon networks does not align to the backoff slot boundaries Sequential freshness Not implemented Secure beacons The current revision of the MAC software does not support secure beacons i e mlemeStartRequest must be called with the securityEnable parameter set to false Security The current revision of the MAC software contains software non conformances and errors with respect to security There are multiple issues with the security specification of the IEEE802 15 4 which are being revised by 802 15 4b MimeRxEnable request in beacon The mlmeRxEnable request primitive should only networks be used with non enable beacon networks For beacon networks use the RX on when the idle PIB in stead 56 UM U17587EE1V0UM00 CHAPTER5 LAYER OVERVIEW DataRequest command frames Data request command frames always have a destination address even if transmitted to the PAN coordinator Disa
21. office equipment communications equipment test and measurement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots High Quality Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime systems safety equipment and medical equipment not specifically designed for life support Specific Aircraft aerospace equipment submersible repeaters nuclear reactor control systems medical equipment or systems for life support e g artificial life support devices or systems surgical implantations or healthcare intervention e g excision etc and any other applications or purposes that pose a direct threat to human life You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics especially with respect to the maximum rating operating supply voltage range movement power voltage range heat radiation characteristics installation and other product characteristics Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified ranges Although Renesas Electronics endeavors to improve the quality and reliability of its products semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions u
22. operations through the UARTS interface e Disable operations through the UART6 interface e Transmit character through the UARTS interface 52 UM U17587EE1VOUMOO CHAPTER 4 APPLICATION DESCRIPTIONS AND OPERATIONS e Transmission completion interrupt service routine e Reception interrupt service routine 4 6 6 MAC SW 78K Sample Main application which manage MAC layer and hardware peripheral initialisation network setting and the running mode process In this file is also defined the Confirm and indication primitives that allow the application layer to confirm or indicate a MAC service primitive 4 6 7 Application Declaration header file This file contains definition declarations global variable declarations and function prototypes declarations for the application layer UM U17587EE1VOUMOO 53 CHAPTER 5 MAC LAYER OVERVIEW This document includes documentation on the NEC library IEEE 802 15 4 Mac Software and on the library use This document does not include functional descriptions of the behaviour of the MAC sublayer primitives To take full advantage of the features within the NEC MAC Software it is necessary to understand the IEE standard 802 15 4 specifications 5 1 MAC Sublayer The MAC Medium Access Control sublayer handles all access to the physical radio channel and is responsible for the following tasks Generating network beacons if the device is a coordinator Synchronising to the beacons Supporting
23. status BOOL securityEnable void mlmeAssociateConfirm WORD AssocShortAddress MAC ENUM status void mlmeBeaconNotifyIndication MLME BEACON NOTIFY INDICATION pMBNI void mlmeCommsStatusindication WORD BYTE srcAddrMode ADDRESS pSrcAddr BYTE dstAddrMode ADDRESS pDstAddr ENUM status void mlmeDisassociateRequest QWORD pDeviceAddress BYTE disassociateReason BOOL securityEnable void mlmeDisassociatelndication QWORD deviceAddress BYTE disassociateReason BOOL securityUse aclEntry void mlmeDisassociateConfirm MAC ENUM status ENUM mlmeGetRequest MAC pibAttribute void pPibAttributeValue void mlmeOrphanindication QWORD orphanAddress BOOL securityUse aclEntry void mlmeOrphanResponse QWORD orphanAddress WORD shortAddress BOOL associatedMember BOOL securityEnable void mlmePollRequest BYTE coordAddrMode WORD coordPANId ADDRESS coordAddress BOOL securityEnable void mlmePollConfirm MAC_ENUM status ENUM mlmeResetRequest BOOL setDefaultPIB mlmeRxEnableRequest BOOL deferPermit UINT32 rxOnTime UINT32 rxOnDuration void mlmeRxEnableConfirm MAC ENUM status ENUM mlmeScanRequest BYTE scanType DWORD scanChannels scanDuration MAC SCAN RESULT pScanResult ENUM mlmeSetRequest MAC pibAttribute void pPibAttributeValue ENUM mlmeStartRequest WORD logicalChannel UINT8 beaconOrde
24. the MAC object file libraries library file must be added to the IAR Workbench project and the path to the header files has to be set in the project option 2 5 1 Linking library to the project PF Embedded Workbench IDE File Edit View Project Tools Window Help x cx Release amp NEC_Zigbee_FFD Release a C3 Application Ha Library m AC 8K0_FFD_Lib r26 Low Level Init Output verview NEC Zighee RFD NEC Zigbee FFD Figure 10 IAR project structure Link the dedicated library to the IAR project as shown by the window above Use the function Project gt Add file UM U17587EE1VOUMOO 25 CHAPTER 2 LIBRARY INSTALLATION AND USE 2 5 2 Provide Header files path Options for node Zighee FFD Release E X Factory Settings General Uptions Language Code List Preprocessor Diagnostics Assembler Estan Build Include paths one per line Linker TOOLEIT_DIRGSING Deb TOULEIT DIRSSINCSCLIBS oar PROJ DIRf LIBRARIESSHEADER FILES Emulator 79 FRUJ DIR SPPLICASTIONSINCLLIDE Simulator Defined symbols per line MIC BK Preprocessor output to file Preserve comments Generate Hine directives Figure 11 Include path project option Provide the header file path in the project option window For example PROJ_DIR L
25. to replace the function with the user supplied function We suggest adding a low level init procedure to your project as it has done for the Release It sample program For further details how to develop this procedure refer to the sample project and source code supplied with the Release It kit 2 5 8 Address Allocations The IEEE 802 14 5 standard specifies the PHYsical PHY and Media Access Control MAC layer The standard employs 64 bit IEEE address and 16 bit short address to support theoretically more than 65 000 nodes per networks The application has to define the network and security It handles device discovery network configuration and address definition 2 5 8 1 MAC Address All devices operating on a network of either topology shall have unique 64 bit extended address This address can be used for direct communication within the PAN or it can be exchanged for a short address allocated by the PAN coordinator when the device associates These addresses have to be communicated to the MAC layer through the use of extern function definitions The 64 bit IEEE address has to be defined as a variable declaration in the dedicated flash area MACADDRESS 16 Bytes setting in the linker file This definition should be part of the application variable declarations Define the unique 64 bit extended address as it is suggested by the following lines in this case add 0x0000004722958919 using the MACADDRESS memory segment S
26. whether the MAC sublayer is to enable its receiver during idle periods The 16 bit address that the device uses to communicate in the PAN If the device is coordinator this value shall be chosen before a PAN is started Otherwise the address is allocated by a coordinator during association A value of Oxfffe indicates that the device has associated but has not been allocated an address A value of Oxffff indicates that the device does not have a short address This specifies the length of the active portion of the superframe including the beacon frame The macSuperframeOrder SO 71 CHAPTER6 APPLICATION PROGRAMMING INTERFACE FOR RELEASE IT PLATFORM and the superframe duration SD are related as follows for SO 14 SD aBaseSuperframeDuration 2 symbols If SO 15 the superframe will not be active following the beacon This attribute is set by the MAC through the mimeStartRequest primitive It must be set by the higher layer before mlmeSyncHRequest is called 0x55 MAC TRANSACTION PERSISTENCE WORD 0x000 The maximum time in TIME 0 superframe periods that a Oxffff transaction is stored by a coordinator and indicated in its beacon 0x70 ACL ENTRY DESCHRIPTOR SET ACL_ Pointer A set of ACL entries each ENTRY containing address _ information security suite information and security material to be used to protect frames between the MAC sublayer
27. 6 bit short or 64 bit extended addresses e Allocation of guaranteed time slots GTSs e Carrier sense multiple access with collision avoidance CSMA CA channel access e Fully acknowledged protocol for transfer reliability e Low power consumption e Energy detection ED e link quality indication LQI 16 channels in the 2450 MHz band 10 channels in the 915 MHz band and 1 channel in the 868 MHz band Two different device types can participate in an LR WPAN network a full function device FFD anda reduced function device RFD The FFD can operate in three modes serving as a personal area network PAN coordinator a coordinator or a device An FFD can talk to RFDs or other FFDs while an RFD can talk only to an FFD An RFD is intended for applications that are extremely simple such as a light switch or a passive infrared sensor they do not have the need to send large amounts of data and may only associate with a single FFD at a time Consequently the RFD can be implemented using minimal resources and memory capacity UM U17587EE1V0UM00 15 CHAPTER1 INTRODUCTION 1 1 Network Types There are 2 basic types of network topology available with IEEE 802 15 4 they are Star Topology and Peer to Peer topology Network coordinator Master slave C Full function device Communications flow C Reduced function device Figure 1 Star Topology In a star network all devices will communicate directly with a central coo
28. ACON NOTIFY INDICATION pMBNI Pointer to Structure 6 4 9 MLME GET Request mlmeGetRequest is used to request the value of a current MAC PIB attribute Parameters mlmeGetRequest MAC_PIB ATTRIBUTE pibAttribute Name of attribute for which information is requested pPibAttributeValue Pointer to the attribute value storage element 6 4 10 MLME GTS The MLME GTS primitives are not implemented in this version of the code 6 4 11 MLME ORPHAN Indication mlmeOrphanilndication is developed by the higher layers and is a generated by the sub layers when an orphan command frame is received from a device performing an orphan scan Parameters mlmeOrphanIndication QWORD orphanAddress Address of orphan device BOOL securityEnable TRUE or FALSE for security UINT8 aclEntry Value to determine if device is in the ACL 6 4 12 MLME ORPHAN Response mlmeOrphanResponse is a response to orphan indication by transmitting a coordinator realignment frame Parameters mlmeOrphanResponse QWORD orphanAddress Address of orphan device WORD shortAddress Short address of the coordinator 64 UM U17587EE1VOUMOO CHAPTER6 APPLICATION PROGRAMMING INTERFACE FOR RELEASE IT PLATFORM BOOL associateMember TRUE or FALSE this device is a member of this PAN BOOL securityEnable TRUE or FALSE security is enabled for the coordinator realignment frame 6 4 13 MLME RESET Request j The mlmeRes
29. AND OPERATIONS Receipt flag Receipt ASCII string Store the received Copy the received string into a data MAC Layer and Anplication Initialisation Running loop Wait for the event flag If LED pattern toggle payload table LEDs and display it Transmit the packet If ASCII string packet transmit it through UART Joystick flag Disassociation flag Toggle LEDs and update the LED pattern If is device send disassociation request Transmit packet flag Start an association process goto Transmit the last data packet which is LED pattern or ASCII string depend on the previous event Figure 30 Run mode flowchart UM U17587EE1VOUMOO 51 CHAPTER 4 APPLICATION DESCRIPTIONS AND OPERATIONS 4 6 Software For detailed information about the software installation please refer to the source code on the installation CD The following software is to provide an indication of where the functions are positioned Notes Low level initialisation Low level init is required main oscillator setting variables initialisation watchdog setting otherwise these have to be a part of the customer application Watchdog management has to be handled by the application or disabled Provide the MAC extended address to the MAC library as it is describe in 4 6 7 Address Allocations The NEC sample application provides a network management example association disassociation add
30. E E I T Sub Clock Glock Board ku Ez ea aram pro ati sare Break Tetas Figure 38 ID78KO TK configuration UM U17587EE1VOUMOO 77
31. IBRARIES HEADER_FILES In this same window add the path to your own application header files For example PROJ_DIR APPLICATION INCLUDE PROJ_DIR is currently the directory where is save the application project 26 UM U17587EE1V0UM00 CHAPTER 2 LIBRARY INSTALLATION AND USE 2 5 3 Stack and Heap size setting Make sure the stack size is at least ox 0x180 byte to match the library requirement and the heap size is 0 The linker file define a stack at most of Ox1FF bytes and a heap of 0 byte Options for node Zigbee FFD Release Categor General Options C C compiler Target Output Library Configuration Library Options MISRA c Assembler Custom Build Processor variant Linker Debugger IE 78 IECLIBE Code model MINICUBE Reg Bank address Simulat Standard 8000 Stack size Gane seer g Bn 2 Figure 12 Stack size project option Options for node NEC_ igbee_FFD Release Category General Options C C compiler Target Output Library Configuration Library Options MISRA Assembler Custom Build Formatter Linker Large Debugger IE 78 Full formatting IECLIBE MINICLIBE Simulator Scant formatter Large formatting Heap size Figure 13 Heap size project option UM U17587EE1VOUMOO 2 CHAPTER 2 LIBRARY INSTALLATION AND USE 2 5 4 Byte alignment data
32. ION PERMIT MAC AUTO REQUEST MAC BATT LIFE EXT 0x44 MAC BATT LIFE EXT PERIODS BYTE BOOL BOOL BOOL BYTE TRUE Or FALSE TRUE Or FALSE TRUE Or FALSE The maximum number of symbols to wait for an acknowledgment frame to arrive following a transmitted data frame This value is dependent on the currently selected logical channel For all channels supported by CC2420 11 through 26 this value should always be set to 54 Indication of whether a coordinator is currently allowing association A value of TRUE indicates that association is permitted The value set here will show up in all transmitted beacons and indicate to others if association is permitted Indication of whether a device automatically sends a data request command if its address is listed in the beacon frame value of TRUE indicates that the data request command is automatically sent Indication of whether battery life extension by reduction of coordinator receiver operation time during the CAP is enabled A value of TRUE indicates that it is enabled The number of backoff periods during which the receiver is enabled following a beacon in battery life extension mode This value is dependent on the currently selected logical channel For all channels supported by CC2420 11 through 26 this value should always be set to 6 0x45 MAC BEACON PAYLOAD BYTE pointer A pointer to the contents of the MAC Beacon Paylo
33. MAC ENUM status void mlmeSyncLossindication MAC ENUM lossReason 1 void mpmSetConfirm BYTE status void mcpsDatalndication MCPS DATA INDICATION pMDI void mlmeAssociatelndication ADDRESS deviceAddress BYTE capabilityInformation BOOL securityUse aclEntry void mlmeAssociateConfirm WORD assocShortAddress MAC ENUM status void mcpsDataConfirm MAC ENUM status BYTE msduHandle void mlmeDisassociateConfirm MAC ENUM status f void mlmeDisassociatelndication QWORD deviceAddress BYTE disassociateReason BOOL securityUse BOOL aclEntry 2 6 3 Data type definitions All the data type definitions external to the application layer and used in the above functions are include in the MAC 78 0 header file To have access to all functions specified in the library and all the data types used in it all the header files used to build the libraries are required These files are the property of NEC and can be provided only with specified agreement with NEC Electronics 36 UM U17587EE1VOUMOO CHAPTER 3 SAMPLE PROJECT INSTALLATION 3 1 General introduction The sample project combines a simple application with the MAC Layer using the IEEE 802 15 4 libraries The application provides interaction with users on the Release it wireless evaluation boards There are two boards in the kit and on power up each board can be connected to the network By the manipulation of the hardware LED patterns can be generated on the boar
34. PDU PHY PSDU PHY RF RFD RSSI RX SAP SD SPDU SSCS SDU SFD SHR SO TRX TX WLAN WPAN physical layer management entity service access point personal operating space protocol data unit service data unit radio frequency reduced function device received signal strength indication receive or receiver Service access point superframe duration protocol data units service data unit start of frame delimiter synchronization header superframe order transceiver transmit or transmitter wireless local area network wireless personal area network UM U17587EE1VOUMOO Table of Contents CHAPTER T INTRODUCTION 2 2 a sa aaa aca a 15 1 Network TY DCS S X X X 16 1 2 Two physical device types for the lowest system cost 18 1 3 PHY Layers uy eS 18 14 Frame Structure eee 19 1 5 20 TOT US 20 1 52 NON BEICON MOG ur u
35. PROJECT INSTALLATION An application project based on this sample which uses the RFD library could require the defined symbol BEACON NETWORK which allows to perform a passive scan This distinction is required because a reduced function device could only perform a passive scan used to locate all coordinators transmitting beacon frames within the POS of the scanning device but the passive scan is a receive only operation Therefore on a Non Beacon Enabled Network a passive scan does not allow to locate coordinator So an association process should be automatically performed on the designated channel 3 4 3 Other options 3 4 3 1 Load file output The stack size is set to 0x180 byte the heap size to 0x00 and the DF0148H V4 ZB xcl linker file is set in the Linker Config Linker command file The built output is a hexadecimal file of the Intel extended format that can be flashed into the Release It board using the FPL writer software V1 10 Options for node Zigbee FFD Release Category Factory Settings General Options C C compiler Output Extra Hdefine Diagnostics List Contig Processing Assembler Custom Build Output file Z Override default Secondary output file EL FFD hex Mane for the selected format Debugger IE 78 Format IELUBE Debug information for MINICUBE ith runtime control modules Simulator emulation modules Buffe
36. Release It wireless starter kit allows customers to prototype and develop wireless applications The kit comprising of 2 wireless networking boards and associated Chipcon CC2420 RF transceiver modules comes complete with all of the relevant SW to implement IEEE 802 15 4 compliant wireless networks The IEEE 802 15 4 specification defines the PHY physical and MAC Media Access Control layers for the development of Wireless Personal Area Networks and clearly defines a set of primitives to allow application software easy access to the wireless networking capabilities The use of primitives allows for a common SW interface for additional protocols to be easily added to the system without any changes to the library for example the Zigbee protocol is directly aware of the SW primitives defined in the IEEE 802 15 4 standard 6 2 Software Interface Interfacing to the MAC layer is done via the primitives there are four basic types of primitives involved 6 2 1 Request A request primitive is sent to the MAC sublayer to request that a MAC service be initiated 6 2 2 Confirm A confirm primitive is generated by the MAC sublayer to the upper layer to convey the result of one or more associated previous service requests Some request functions such as mlmeSetRequest will return the confirm value directly from the request function through the enumerated type MAC ENUM The confirm primitive is therefore not implemented as a separate function call This i
37. SetRequest primitive is used to set the value in the MAC PIB Parameters mlmeSetRequest ATTR pibAttribute The PIB attribute to be changed pPibAttributValue A pointer to the PIB Attribute Note this attribute is changed in the PIB This procedure returns a value of INVALID PARAMETER SUCCESS or UNSUPPORTED ATTRIBUTE hence there is no requirement for a Confirm primitive 6 4 19 MLME START Request The mlmeStartRequest primitive is issued by the coordinator to start a new WPAN Parameters mlmeStartRequest WORD The new PAN Identifier UINT8 logicalChannel The channel to operate on UINT8 beaconOrder Defines the beacon interval 0 14 for beacon PAN 15 for non beacon PAN UINT8 superframeOrder Superframe duration must be lt to beacon order BOOL panCoordinator TRUE if node should be a PAN coordinator BOOL batteryLifeExtension Enable battery life extension BOOL coordRealignment Transmit a coordinator realignment frame before making the change BOOL securitEnable Enable security TRUE or FALSE UM U17587EE1VOUMOO 67 CHAPTER6 APPLICATION PROGRAMMING INTERFACE FOR RELEASE IT PLATFORM The mlmeStartRequest procedure has the following return values SUCCESS NO SHORT ADDRESS INVALID PARAMETER hence there is no requirement for Confirm primitive 6 4 20 MLME SYNC Request mlmeSyncRequest primitive is used to synchronise to a coordinator by acquiring and if specified trackin
38. The recommended applications of an NEC Electronics product depend on its quality grade as indicated below Customers must check the quality grade of each NEC Electronics product before using it in a particular application Standard Computers office equipment communications equipment test and measurement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots Special Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime systems safety equipment and medical equipment not specifically designed for life support Specific X Aircraft aerospace equipment submersible repeaters nuclear reactor control systems life support systems and medical equipment for life support etc The quality grade of NEC Electronics products is Standard unless otherwise expressly specified in NEC Electronics data sheets or data books etc If customers wish to use NEC Electronics products in applications not intended by NEC Electronics they must contact an NEC Electronics sales representative in advance to determine NEC Electronics willingness to support a given application Note 1 NEC Electronics as used in this statement means NEC Electronics Corporation and also includes its majority owned subsidiaries 2 NEC Electronics products means any product developed or manufactured by or for NEC Electronics
39. To our customers Old Company Name in Catalogs and Other Documents On April 15 2010 NEC Electronics Corporation merged with Renesas Technology Corporation and Renesas Electronics Corporation took over all the business of both companies Therefore although the old company name remains in this document it is a valid Renesas Electronics document We appreciate your understanding Renesas Electronics website http www renesas com April 1 2010 Renesas Electronics Corporation Issued by Renesas Electronics Corporation http www renesas com Send any inquiries to http www renesas com inquiry 24 NE S AS 8 10 11 12 All information included in this document is current as of the date this document is issued Such information however 15 subject to change without any prior notice Before purchasing or using any Renesas Electronics products listed herein please confirm the latest product information with a Renesas Electronics sales office Also please pay regular and careful attention to additional and different information to be disclosed by Renesas Electronics such as that disclosed through our website Renesas Electronics does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from the use of Renesas Electronics products or technical information described in this document No license express implied or otherwise
40. ad UM U17587EE1VOUMOO 69 CHAPTER6 APPLICATION PROGRAMMING INTERFACE FOR RELEASE IT PLATFORM used by a coordinator when transmitting a beacon MAC_BEACON_PAYLOAD_LENGTH BYTE The length of the MAC Beacon Payload used by a coordinator when transmitting a beacon 0 52 ORDER BYTE 0 15 Specification of how often the coordinator transmits a beacon This attribute is set by the MAC through the mimeStartRequest primitive It must be set by the higher layer before mlmeSyncRequest is called MAC_BEACON_TX_TIME WORD The time that the device Oxfffffff transmitted its last beacon f frame in symbol periods This attribute should only be read not written MAC_BSN The sequence number added to the transmitted beacon frame X4A MAC COORD EXTENDED ADDRESS WORD An The 64 bit address of the extend coordinator with which the ed 64 device is associated bit IEEE addres S 0 COORD SHORT ADDRESS WORD 0x000 The 16 bit short address 0 assigned to the coordinator with which the device is associated A value of Oxfffe indicates that the coordinator is only using its 64 bit extended address A value of Oxffff indicates that this value is unknown MAC_DSN BYTE 0x00 The sequence number added Oxff to the transmitted data or MAC command frame OxAD MAC GTS PERMIT BOOL TRUE TRUE if the PAN coordinator or is to accept GTS requests FALSE FALSE otherw
41. ard Properties EIE Connect To Settings Board L ountry region United Kingdom 44 Enter the area code without the long distance prefix Area code 44 Phone number Connect using virtual COM Configure countu region code ari area code Redial buey Figure 27 HyperTerminal Settings ASCII Setup ASCII Sending Send line ends with line feeds Echo typed characters locally Line delay E millisecands Character delay 0 millisecands ASCII Receiving Append line feeds to incoming line ends Force incoming data to 7 bit ASCII wrap lines that exceed terminal width Figure 26 HyperTernimal Port Settings COMS Properties E Port Settings Bits second Data bits e Parity None Stop bits 1 Flow control None Restore Defaults Figure 28 HyperTerminal ASCII Settings Each ASCII character is directly transmitted to the Release It board and handle by the UART6 received interup routine This ISR stored it in a buffer table of 28 bytes The carriage return code denotes the end of the string and requests the system start a transmission task In this application the packets send are communicating the ASCII string between each evaluation board The reception of a chat packet managed by the library will be transmit through the UART to the HyperTerminal communications
42. arget uses the 1078f0148h ddf device description file which is located in the directory 78K0 Sample DEVICE FILEddf 3 3 Project use The IAR Systems Embedded Workbench must be installed on your PC For detailed installation hints refer to the documentation of the corresponding products To open a project you can start the IAR Systems Embedded Workbench and open the NEC MAC SW Workspace eww workspace or directly launch it by double clicking on the eww file 38 UM U17587EE1VOUMOO CHAPTER3 SAMPLE PROJECT INSTALLATION 9j Embedded workbench IDE E Joystick App c H MAC Sw 78K Sample c UART Transmission He E Library RELEASE Lib 0 rb E Lowe Level Init low level init mac c Output d RELEASE APP FFD hex Ready Figure 19 Sample project structure Two projects are defined in this workspace MAC_78KO_FFD_PROJ 78 0 RFD PROJ The difference in these projects is in the library used UM 17587 1 00 00 39 CHAPTER3 SAMPLE PROJECT INSTALLATION 3 4 Library setting 3 4 1 Include paths The library is added to the project in the same way as any other file and the path of the library s header file is set in the project option C Compiler gt Preprocessor Options for node Zigbee FFD Release Category Factory Settings General Options Language Code Output List Prep
43. ch Milton Keynes UK 01908 691 133 Fax 01908 670 290 UM U17587EE1VOUMOO NEC Electronics Hong Kong Ltd Hong Kong 2886 9318 Fac 2886 8022 0044 NEC Electronics Hong Kong Ltd oeoul Branch oeoul Korea 002 528 0303 Fax 02 528 4411 NEC Electronics Singapore Pte Ltd oingapore Tel 5 s s 522042055553 NEC Electronics Taiwan Ltd Taipei Tawan 02 2719 2377 Fac 02 2719 5951 Overview Wireless personal area networks WPANs are used to convey information over relatively short distances Unlike wireless local area networks WLANs connections effected via WPANS involve little or no infrastructure This feature allows small power efficient inexpensive solutions to be implemented for a wide range of devices Purpose NEC Electronic in collaboration with CHIPCON has developed a new starter kit to allow its customers to realise new wireless applications The starter kit which is based on the 78K0 KF 1 includes two fully functional modules Also supplied is a fully optimized library for the IEEE 802 15 4 MAC Layer Software and applications development and programmer tools Reference IEEE 802 15 4 Wireless Medium Access Control MAC and Physical Layer PHY Specifications for Low Rate Wireless Personal Area Networks LR WPANs UM U17587EE1VOUMOO 5 Definitions For the purposes of this standard the following terms and definitions apply Terms not defined i
44. coordinator to instruct an associated device to leave the PAN Parameters mlmeDisassociateRequest pdeviceAddress Coordinator Pointer to extended address of device to disassociate Device Pointer to extended address of coordinator BYTE dissassociateReason Dissassoctiation reason BOOL securityEnable Security enabled TRUE or FALSE 6 4 6 MLME DISASSOCIATE Indication The mlmeDisassociatelndication is used to indicate to a higher layer that a disassociation request has been received Parameters mlmeDisassociateIndication pdeviceAddress Coordinator Pointer to extended address of device to disassociate Device Pointer to extended address of coordinator dissassociateReason Dissassoctiation reason securityEnable Security enabled TRUE or FALSE aclEntry TRUE or FALSE sender in ACL table 6 4 7 MLME DISASSOCIATE confirm The mlmeDisassociateConfirm primitive is issued by the disassociation requester to the higher layers to indicate status of disassociation Parameters mlmeDisassociateConfirm MAC ENUM otatus of disassociation UM U17587EE1VOUMOO 63 CHAPTER6 APPLICATION PROGRAMMING INTERFACE FOR RELEASE IT PLATFORM 6 4 8 MLME BEACON NOTIFY Indication mlmeBeaconNotifyIndication primitive is a callback function that needs to be implemented by the higher layers This indicates reception of a Beacon frame with a Beacon Payload Parameters mlmeBeaconNotifyIndication MLME BE
45. ction device FFD 22 UM U17587EE1VOUMOO CHAPTER 2 LIBRARY INSTALLATION AND USE e Reduced function device RFD The libraries provide an interface between the Application Network layer and the MAC Layer by providing external primitives To the primitives are added functions required for a correct use of the libraries as MAC_78KO_Init setattribute getattribute resetrxfifo flushtxfifo These libraries are provided with three header files that share the required function prototypes definitions and variable declarations with the application layer Path Compact Disc Library Object Files Figure 9 Libraries These folders are provided with the Release It kit e Full function device Library e Object file MAC 78KO FFD Lib r26 Reduced function device Library e Object file MAC 78 Lib r26 e Header files common to the both libraries e Header file Data Types h Mac 78KO h Function Prototypes h e Linker file common to the both libraries modified for MAC requirements e Linker DFO0148H V4 ZB xcl The libraries are IAR library objet files built with IAR Systems Embedded Workbench There are two libraries one for full function device FFD and one for reduced function device RFD 23 IAR Systems Embedded Workbench for 78K0 KOS installation The IAR Systems Embedded Workbench for 78KO KOS required for the starter kit is the time limited evaluation version This version EW78K is code size unlimited and off
46. d in use This provides a visual representation of the hardware selection Once a pattern for the LEDs has been selected the board can then transmit this pattern to the other board in the network This will synchronise the two boards and they will both display the same pattern until another pattern is selected and transmitted from either board By the use of a HyperTerminal as graphic user interface this application also allow to transmit string of ASCII to the other board in the network also linking to an hyper terminal window In this application the packets send are communicating the ASCII string between each evaluation board This shows the ability of the boards to communicate any data with each other via the IEEE 802 15 4 protocol In this application the packets sent are communicating the LED pattern or ASCII string between each evaluation board However this communication could be any information the user requires to control the hardware send data or request information 3 2 Project directory The main directory contains the sub folder for the project files for the IAR Systems Embedded Workbench 78 0 05 and also the following sub folders UM U17587EE1V0UM00 37 CHAPTER3 SAMPLE PROJECT INSTALLATION EC 78K0 Sample El ce Application Main directory Application folder Contains the source code HL Include of the C and H files of demo application 22214171 Source 2 Device File t ddf Device
47. e library function mlmeRxEnableRequest Figure 17 Library initialisation flowchart 34 UM U17587EE1VOUMOO CHAPTER 2 LIBRARY INSTALLATION AND USE 2 6 Library Functions The interface between the Application Network Layer NWK and the MAC Logical Management Entity Layer MLME is based on service primitives passed from one layer to the other using the libraries 2 6 1 Functions defined by the libraries For more detail refer to the Function_Prototypes header file and to the IEEE 802 14 5 standard void Mac 78 init Initialise the library for the 78KO Release It kit void Flush TX Fifo Flush chipcon s FIFO for reset void halWait UINT16 timeout void halWriteAddress BYTE pData void halWriteAddress BYTE pData void mcpsDataRequest BYTE addrModes WORD srcPanld ADDRESS pSrcAddr WORD destPanld ADDRESS pDestAddr UINT8 msduLength BYTE pMsdu BYTE msduHandle BYTE txOptions void mcpsDataConfirm MAC ENUM status BYTE msduHandle void mcpsDatalndication MCPS DATA INDICATION pMDI ENUM mcpsPurgeRequest BYTE msduHandle void mlmeAssociateRequest UINT8 logicalChannel BYTE coordAddrMode WORD coordPANId ADDRESS pCoordAddress BYTE capabilityInformation BOOL securityEnable void mlmeAssociatelndication ADDRESS deviceAddress BYTE capabilityInformation BOOL securityUse aclEntry void mlmeAssociateResponse ADDRESS deviceAddress WORD assocShortAddress MAC ENUM
48. e NEC Debugger ID78K0 QB software tool allows to download image into embedded flash memory with a MiniCube and support debugger features The ID78KO0 TK is software that added the module for 78 to 1078 It corresponds to the MINICUBE interface between 78 0 and the target system so that the On Chip Debugger features are available from the ID78K0 QB without MINICUBE To install the ID78KO QB and the ID78KO0 TK is software select the SETUP programs The set up dialogues will guide you through the installation process For further information please refer to the relative user s manual It is necessary to set the COM port number for ID78KO TK to communicate with the 78 0 board beforehand Please choose program P gt Tools32 gt Portconfig for ID78KO TK of a Windows start menu Please choose the COM port number of target device checked by the device manager USB serial port COM and click the Setting button 2515 Port 4 Cancel Figure 35 Port configuration for ID78K0 TK 74 UM U17587EE1V0UM00 7 APPENDIX NEC DEBUGGER INSTALLATION AND USE The debugging of the application using the Release It board uses the on chip debug feature of the 78F0148 device For debugging with the NEC debugger set the output format to XCOFF78 and the debugger driver to Minicube The io78f0148h ddf file must to be selected in the device description area Option
49. e access point for the data primitives The MCPS DATA primitives are used to transport data between network entities TT CF rignator Recipient next lave Layer MCPS DAT Atequest Data frame Ac now eign ent request ech 2 indication MICE S DATA confi Figure 34 Message sequence for the MAC data sservice 6 3 1 MCPS DATA Request mcpsDataRequest procedure is used to initiate a data transfer Parameters mcpsDataRequest BYTE addrModes Type of address mode WORD srcPanld Source PAN ID ADDRESS PSrcAddr Pointer to source address WORD destPanld Destination PAN ID ADDRESS pDestAddr Pointer to destination address UINT8 msduLength Payload Length BYTE pmsdu Pointer to payload BYTE msduHandle Handle the packet used by confirm and purge procedures BYTE txOptions Bit of various transmit options 6 3 2 MCPS DATA Confirm mcpsDataConfirm reports the result of an mcpsDataRequest procedure Parameter mcpsDataConfirm MAC_ENUM status Status of transfer BYTE msduHandle Handle to relevant packet 6 3 3 MCPS_DATA Indication The mcpsDatalndication procedure is used to indicate the reception of a data packet 60 UM U17587EE1VOUMOO CHAPTER6 APPLICATION PROGRAMMING INTERFACE FOR RELEASE IT PLATFORM Parameter mcpsDataIndication 5 DATA INDICATION pMDI Pointer to MCPS INDICATION STRUCTURE T
50. e beacon frames containing any PAN identifier Orphan Scan To locate a PAN to which a device is currently associated Parameters mlmeScanRequest BYTE Type of scan to perform DWORD scanChannels Bitmap to determine the channels to scan 1 scan channel 0 do not scan channel The logical bitmap for the 16 channels in the 2 4 Ghz band is 0 07 800 UINT8 scanDuration Time to be spent scanning each channel MAC SCAN RESULT pScanResult Pointer to the MAC SCAN RESULT structure the MAC SCAN RESULT structure is defined by the higher layer j 6 4 17 MLME SCAN Confirm The status of mlmeScanRequest is returned directly by the mlmeScanRequest procedure so a MLME SCAN Confirm primitive is not required MLME COMM STATUS Indication The mlmeComm8Statusindication primitive must be implemented by the higher layers and is called by the MAC sub layer as a result of a Response request or the reception of an error frame during secure processing Parameters mimeCommeStatusindication 66 UM U17587EE1VOUMOO CHAPTER6 APPLICATION PROGRAMMING INTERFACE FOR RELEASE IT PLATFORM WORD Address of device from which frame was received or to which frame must be sent BYTE srcAddrMode Source address mode ADDRESS oSrcAddr Pointer to source address BYTE dstAddrMode Destination Address Mode ADDRESS DstAddr Pointer to destination address MAC ENUM Status of indication j 6 4 18 MLME SET Request mlme
51. ect SU Clu e u u u m ao te spina 39 Figure 20 Include path project option 40 21 DIO ECl ODOM ER EM IE 41 Figure 22 RPE GUI WING OW u u 42 Figure 23 Deb g output project optio ites 43 Figure 24 On Chip Debugger project 44 Figure 25 HyperTerminal Port Connection Figure 26 HyperTernimal Port Settings 48 Figure 27 HyperTerminal Settings Figure 28 HyperTerminal ASCII Settings 48 Figure 29 Sample application 50 Figuress0 RUnImMOde i ee i ea aus 51 Figure Sublavel Dues mu N 54 Figure 32 Communication to a coordinator in non beacon enabled network 55 Figure 33 Communication to a coordinator in a beacon enabled 55 Figure 34 Message sequence for the MAC data 60 FIGure 3 5 PorbcohligBradoti Tor TD 9IS 0 FI u uu uuu bi oda Md Ox et ale eco a ha Voces bs 74 Figure 36 ID78K0 QB Debug output project option 75 Figure 37 IAR Configure Tools
52. ers an Integrated Development Environment for the NEC 78 0 78 05 microcontrollers It is available on the on the IAR webpage http www iar com and the direct link to the webpage to download the evaluation version for 78 5 is http wwwijobb4 iar se Download SW item EW78K EVAL For detailed use hints refer to the data sheet section This product contains software components that use a licensing system to prevent illegal use You have to registration page and you will receive an e mail containing license information that is required during the installation of the evaluation software Then click on the Submit Registration and Download During the installation the set up dialogues will guide you through the installation process UM U17587EE1VOUMOO 23 CHAPTER 2 LIBRARY INSTALLATION AND USE 2 4 IAR project setting To use library in an application running on an NEC 78 microcontroller create a new IAR C project for 78KO device Add your own group and application files Also add the required library to your project Save your project in your application workspace Note In your Windows explorer it is suggested to create a project folder for your application and add in it a copy of the Libraries Device File and Linker File folders The libraries folder contains FFD and RFD object files and the three header files 24 UM U17587EE1VOUMOO CHAPTER 2 LIBRARY INSTALLATION AND USE 2 5 Library installation To use
53. et the physical node address constseg MACADDHRESS root const QWORD macaddress1 0x22958919 0x00000047 root const QWORD macaddress2 0x22958920 0x00000047 constseg default The libraries require this extended address definition In the library s header file MAC 78 0 it is defined an external QWORD To transmit the address value use the following declaration Extended address must be set by higher layer extern saddr QWORD aExtendedAddress This variable has to be set in the main function by calling the library function halReadAddress 32 UM U17587EE1VOUMOO CHAPTER 2 LIBRARY INSTALLATION AND USE read MAC address from FLASH and write in RAM variable ptrTemp BYTE amp aExtendedAddress Idword halReadAddress ptr Temp isCoordinator The second parameter is a boolean True allows it to read the first MAC address and false allows it to read the second one The option to provide two extended address was developed for the Release lt sample program For further information and details on how to set the network addresses refer to the sample project and source code supplied with the Release lt kit 2 5 8 2 Attributes and local address setting Before using the libraries the following attributes and address definition have to be set by the application layer Local address definition Panld PANID DestPanld DEST PANID NodeAdd Short DEVICE_SHORT SecuMode 0x00
54. etRequest primitive resets the MAC PHY and all state machines Parameters mlmeResetRequest BOOL setDefaultPIB TRUE or FALSE also reset the PIB to default values j This primitive always returns success and therefore there is no MLME RESET Confirm primitive 6 4 14 MLME RX ENABLE Request The mlmeRxEnableRequest primitive is called from the higher layers to turn on the receiver for a period of time Parameters mlmeRxEnableRequest BOOL deferPermit Reception can be deferred till the next superframe UINT32 rxOnTime Number of symbol times to elapse before turning receiver on UINT32 rxOnDuration Number of symbol periods to listen before turning receiver off Note This procedure is currently only supported on Non Beacon enabled 6 4 15 MLME RX ENABLE Confirm The mlmeRxEnableConfirm primitive is called from the MAC sub layers and must be implemented by the higher layers This primitive provides the results of the mlmeRxEnableRequest Parameters mlmeRxEnableConfirm MAC_ENUM Status of the above request 6 4 16 MLME SCAN Request mlmeScanRequest primitive is called by the higher layers to perform scan within the POS Personal Operating Space of the device Several types of scan are available Energy Detect to detect which channels are in use To locate beacon frames containing any PAN identifier UM U17587EE1VOUMOO 65 CHAPTER6 APPLICATION PROGRAMMING INTERFACE FOR RELEASE IT PLATFORM To locat
55. g its beacons It is recommended that you synchronise to a beaconing coordinator before association to that coordinator Parameters mlmeSyncRequest UINT8 logicalChannel The frequency channel to synchronise to BOOL Track the selected coordinators beacon 6 4 21 MLME SYNC LOSS Indication mlmeSyncLossindication primitive must be implemented in the higher layer it is called from MAC sub layers when synchronisation is lost with a coordinator Parameter mlmeSyncLossIndication MAC ENUM Reason why synchronisation was lost 6 4 22 MLME POLL Request mlmePollRequest primitive is used to request indirect data from a coordinator Parameter mlmePollRequest BYTE coordAddrMode Short or extended address mode WORD coordPANId The PAN id of the coordinator ADDRESS pCoordAddress Pointer to the coordinator address BOOL seccurityEnable TRUE or FALSE 6 4 23 MLME POLL Confirm The mlmePollConfirm primitive is generated by the higher layers in response to an mimePoliRequest Parameters mlmePollConfirm MAC ENUM Status of poll request 68 UM U17587EE1VOUMOO CHAPTER6 APPLICATION PROGRAMMING INTERFACE FOR RELEASE IT PLATFORM 6 5 MAC PIB The MAC PIB PAN information base contains all of the information required to manage the MAC sub layer of a device Access to the information base is the mlmeGetRequest and mlmeSetRequest procedures Table 6 MAC PIB attributes WAIT DURATION MAC ASSOCIAT
56. his procedure is usually developed as part of the main customer application 6 3 4 MCPS DATA Purge The mcpsPurgeRequest procedure is used to terminate a previously requested data transfer Parameters mcpsPurgeRequest BYTE msdnhandle handle to requested packet j 64 MLME SAP The MLME SAP primitives are the Service Access Points for the management functions of the MAC layer The following MLME SAP primitives are supported TJ Request indication Response Confirm S CdS usd j 6 4 1 MLME ASSOCIATE Request The mlmeAssociateRequest procedure is used to request association to a coordinator on a WPAN network UM U17587EE1VOUMOO CHAPTER6 APPLICATION PROGRAMMING INTERFACE FOR RELEASE IT PLATFORM Parameters mlmeAssociateRequest UINT8 LogicalChannel RF channel to use BYTE CoordAddrMode Short or Extended Address WORD CoordPANId Coordinator PAN Identifier ADDRESS CoordAddress Pointer to address of coordinator BYTE CapabilityInformation Bitmap field of capabilities BOOL SecurityEnable Security Enabled TRUE or FALSE j 6 4 2 MLME ASSOCIATE Indication The mlmeAssociatelndication procedure indicates the reception of an association request this procedure is only executed on the coordinator It is the responsibili
57. ions SW6 RESET SW2 Selects Device on the Network SW3 Selects Coordinator on the Network UM U17587EE1VOUMOO 45 CHAPTER 4 APPLICATION DESCRIPTIONS AND OPERATIONS 4 3 1 Device When switch 2 SW2 is pressed Device type network association will be selected for this board This means that the board will operate as the slave within the network able to only to transmit and receive data to from the coordinator When set as a device the board will start to scan for the coordinator on the local network until one is found The scan process is indicated by LED 3 ON When a coordinator is found the following occurs e An association request is made by the device the coordinator e Acknowledgement is then received back from the coordinator e The device will then send a Data Request back and e The coordinator then acknowledges and provides an association response An Association response contains the association status This should contain a success value and with this a network short address which is a16 bit length Once this is completed LED 3 OFF and LED 2 ON indicating a correct status and network address The program will now enter Run Mode ready for the main application to be used 4 3 2 Coordinator When switch 3 SW3 is pressed Coordinator type network association will be selected for this board This means that the board will operate as the manager within the network able to control and supervise the net
58. ions It handles device discovery and network configuration The Libraries offered with the Release it kit are built for the 78 0148 device The libraries must be used with the header files and linker file provided and a target which matches the Release It hardware configuration These header files can be integrated with user s application files The files may be used as reference but users are free to make any modifications However system definitions such as C structures should not be changed as they are configured for the MAC and PHY layers The following sections deal with how to use these libraries in an IAR Workbench project which is based on the sample project supplied with the Release It kit 2 1 Hardware requirements e The minimal hardware requirements for IEEE 802 15 4 networking supported by this library are ROM 20 Kbytes e RAM 1500 bytes e Timer 51 e Timer 001 e Timer 011 CSI port e INTPO e General purpose 1 0 lines 6 maximum e Development tools and software required AR Embedded Workbench for 78 0 05 and 78 0 simulator debugger are required to build the project and use the libraries e FPL FLASH programming software to program the NEC 78KO KF1 microcontroller in circuit is required e Full sample project for the NEC 78K0 KF1 using IAR Systems Embedded Workbench is included in the Release It kit 22 Object Library files The IEEE standard defines two types of devices e Full fun
59. is granted hereby under any patents copyrights or other intellectual property rights of Renesas Electronics or others You should not alter modify copy or otherwise misappropriate any Renesas Electronics product whether in whole or in part Descriptions of circuits software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples You are fully responsible for the incorporation of these circuits software and information in the design of your equipment Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits software or information When exporting the products or technology described in this document you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations You should not use Renesas Electronics products or the technology described in this document for any purpose relating to military applications or use by the military including but not limited to the development of weapons of mass destruction Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture use or sale is prohibited under any applicable domestic or foreign laws or regulations Renesas Electronics has used reasonable care in preparing the information included in this docume
60. ise This value should always be set to FALSE since GTS is currently implemented Ox4E MAC_MAX_CSMA_BACKOFFS 0 5 The maximum number of backoffs the CSMA CA algorithm will attempt before declaring a channel access failure backoff exponent in the 70 UM U17587EE1VOUMOO CHAPTER6 APPLICATION PROGRAMMING INTERFACE FOR RELEASE IT PLATFORM MAG PAN ID 0x53 MAC PROMISCUOUS MODE MAC RX ON WHEN IDLE MAC SHORT ADDRESS MAC SUPERFRAME ORDER 0 000 0 Oxffff WORD BOOL BOOL WORD Oxffff UM U17587EE1VOUMOO CSMA CA algorithm Note that if this value is set to O collision avoidance is disabled during the first iteration of the algorithm Also note that for the slotted version of the CSMACA algorithm with the battery life extension enabled the minimum value of the backoff exponent will be the lesser of 2 and the value of MAC MIN BE The 16 bit identifier of the PAN on which the device is operating If this value is the device is associated This attribute must be set by the higher layer to the PANId of the network to which association is attempted This indicates whether the MAC sublayer is in a promiscuous receive all mode A value of TRUE indicates that the MAC sublayer accepts all frames received from the PHY This attribute can only be set to FALSE because the current IEEE 802 15 4 specification does not specify the promiscuous mode This indicates
61. lectronics products or if you have any other inquiries Note 1 Renesas Electronics as used in this document means Renesas Electronics Corporation and also includes its majority owned subsidiaries Note 2 Renesas Electronics product s means any product developed or manufactured by or for Renesas Electronics 44 N S lt SASS User s Manual 8 bit MCU Release it Demo Kit Document No U17587EE1VOUMOO Date Published June 2005 NEC Electronics Corporation 2005 Printed in Germany 2 UM U17587EE1VOUMOO The information in this document is current as of June 2003 The information is subject to change without notice For actual design in refer to the latest publications of NEC Electronics data sheets or data books etc for the most up to date specifications of NEC Electronics products Not all products and or types are available in every country Please check with an NEC Electronics sales representative for availability and additional information No part of this document may be copied or reproduced in any form or by any means without the prior written consent of NEC Electronics NEC Electronics assumes no responsibility for any errors that may appear in this document NEC Electronics does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from the use of NEC Electronics products listed in this document or any o
62. n this clause can be found in the The Authoritative Dictionary of IEEE Standards Terms Seventh Edition 1 Access control list ACL Alternate personal area network PAN coordinator Association Coordinator Coverage area Device Disassociation Frame Full function device FFD Logical channel Orphaned device Personal area network PAN coordinator Payload data Protocol data unit PDU Packet Personal operating space POS Security suite A table used by a device to determine which devices are authorized to perform a specific function A coordinator that is capable of replacing the personal area network PAN coordinator should it leave the network for any reason A PAN can have zero or more alternate PAN coordinators The service used to establish a device s membership in a wireless personal area network WPAN An full function device FFD that is configured to provide synchronization services through the transmission of beacons If a coordinator is the principal controller of a personal area network PAN it is called the PAN coordinator The area where two or more IEEE 802 15 4 units can exchange messages with acceptable quality and performance Any entity reduced function device RFD or full function device FFD containing an implementation of the IEEE 802 15 4 medium access control MAC and physical interface to the wireless medium The service that removes an existing a
63. nder certain use conditions Further Renesas Electronics products are not subject to radiation resistance design Please be sure to implement safety measures to guard them against the possibility of physical injury and injury or damage caused by fire in the event of the failure of a Renesas Electronics product such as safety design for hardware and software including but not limited to redundancy fire control and malfunction prevention appropriate treatment for aging degradation or any other appropriate measures Because the evaluation of microcomputer software alone is very difficult please evaluate the safety of the final products or system manufactured by you Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product Please use Renesas Electronics products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances including without limitation the EU RoHS Directive Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations This document may not be reproduced or duplicated in any form in whole or in part without prior written consent of Renesas Electronics Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas E
64. nt but Renesas Electronics does not warrant that such information is error free Renesas Electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein Renesas Electronics products are classified according to the following three quality grades Standard High Quality and Specific The recommended applications for each Renesas Electronics product depends on the product s quality grade as indicated below You must check the quality grade of each Renesas Electronics product before using it in a particular application You may not use any Renesas Electronics product for any application categorized as Specific without the prior written consent of Renesas Electronics Further you may not use any Renesas Electronics product for any application for which it is not intended without the prior written consent of Renesas Electronics Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for an application categorized as Specific or for which the product is not intended where you have failed to obtain the prior written consent of Renesas Electronics The quality grade of each Renesas Electronics product is Standard unless otherwise expressly specified in a Renesas Electronics data sheets or data books etc Standard Computers
65. ntervals can vary between 15ms and approximately 4 minutes Devices on the network use the beacons to synchronise access to the network In between each beacon there are 16 equal time slots allocated for message delivery The channel for access is normally contention based but the coordinator can guarantee up to seven channels for devices that require non contention based low latency delivery Ps Contention Access Guaranteed Access Figure 6 Superframe structure with GTSs 1 5 2 Non Beacon Mode This mode is conventional CSMA CS Carrier sense multiple access with collision avoidance this is where a device can access the network at any time as long as the required channel is free The 802 15 4 standard incorporates mechanisms for determining if a channel is free The 2 4 Ghz global ISM band supported by the NEC starter kit has access to 16 channels each of 256Kbps The channel assignment from channels 11 26 is shown below 2 4 GHz PHY Channels 11 26 5 MHz 2 4 GHz 2 4835 GHz Figure 7 2 4 Ghz global ISM band 20 UM U17587EE1V0UM00 CHAPTER1 INTRODUCTION 16 Zigbee Stack The NEC wireless starter kit fully supports the IEEE 802 15 4 wireless networking standard and numerous applications can be realised using this however the kit is ready for the new emerging ZigBee protocol The following diagram shows the relationship between IEEE 802 15 4 and ZigBee ZigBee Device Object Application Object Sec
66. oard with device association push the joystick in any direction The LED pattern will appear as shown in Table 2 3 Then to transmit this to the other board Coordinator press SWS The packet is then transmitted to the coordinator board and the same LED pattern will appear on this board Both boards now have the same LED pattern Now on the Coordinator board select a LED pattern as done previously by using the joystick Press SW3 to transmit this back to the Devices board Both boards again have the same pattern Repeat the operation to use this application If chat transmission is set type out sentences into the PC communications program window and send it using the carriage return key To disassociate use SW2 on the Device board This will disassociate the device from the coordinator for a short period LED 3 will turn on the board will re associate with a new short address and LED will turn off while LED 2 turns on UM U17587EE1VOUMOO 49 CHAPTER 4 APPLICATION DESCRIPTIONS AND OPERATIONS 45 Application flowchart Low level initialisation Mac layer initialisation Application peripheral Initialisation Network role Uart initialisation Toggle LEDs Association process If is coordinator start to set a new network If is device scan for a coordinator and start an association process Update the PIB Figure 29 Sample application flowchart 50 UM U17587EE1VOUMOO CHAPTER 4 APPLICATION DESCRIPTIONS
67. ocol data units SPDUs between peer SSCS entities Table 1 lists the primitives supported by the MCPS SAP Primitives marked with a are optional for an RFD Table 3 MCPS SAP primitives MCPS SAP primitive Request Confirm Indication Coordinator Acknowledament optional Figure 32 Communication to a coordinator in a non beacon enabled network Beacon Network Device Data Acknowledgment optional Figure 33 Communication to a coordinator in a beacon enabled network 5 4 management service The MLME SAP allows the transport of management commands between the next higher layer and the MLME Table 2 summarises the primitives supported by the MLME through the MLME SAP interface Primitives marked with a are optional for an RFD Table 4 MLME SAP primitives Name Request indication Response Confirm _ X x xP 3 UM U17587EE1VOUMOO 55 CHAPTER5 LAYER OVERVIEW MLME RESET MLME RX ENABLE n 5 X MLME SET X X MLME POLL X 5 5 MAC Software limitations and Bugs The current MAC software is dedicated to the NEC 78K0148 device The MAC software may be optimised for parameters such as performance code size RAM size and power consumption Porting the MAC software to other NEC 8 bit microcontroller will be done on a customer project to customer project and requires an
68. programs Note For an Associated Device transmission is fixed to transmit only to it s coordinator For the Network Coordinator the transmission is open to all devices Therefore to select a specific device to transmit data the device first need to transmit the first packet to the coordinator allowing the coordinator to opt for the correct destination address from it s list of devices on the network 48 UM U17587EE1VOUMOO CHAPTER 4 APPLICATION DESCRIPTIONS AND OPERATIONS 4 4 2 Operation Procedure The following steps describe the method of utilising this application Please use these for setup initialisation and operation of the boards for this application 1 2 3 as If attempting to use the chat transmission set up host PC communications programs Connect each of the board to their battery and power up the system If attempting to use the chat transmission connect each of the board to a host PC communications programs via USB cable To ensure operation is running correctly press the reset button SW6 Choose a board to be used as the Coordinator and select Coordinator association by pressing SW2 All LED s should then turn on once initialisation is completed The other board needs to then operate as the device Press SW3 to select Device Association The LED 3 will turn on for a short period and then turn off while LED 2 turns on The boards are now in Run Mode and the application is ready to use On the b
69. r UINT8 superframeOrder BOOL panCoordinator BOOL batteryLifeExtension BOOL coordRealignment BOOL securityEnable void mlmeSyncRequest UINTS8 logicalChannel BOOL trackBeacon void mlmeSyncLossindication MAC ENUM lossReason UM U17587EE1VOUMOO 35 CHAPTER 2 LIBRARY INSTALLATION AND USE void mpmSetRequest BYTE mode void mpmSetConfirm BYTE status BYTE mpmGetState void 2 6 2 Confirm and Indication functions Confirm and indication primitives are generated by the library s MLMEs and issued to the higher application layer to confirm or indicate a MAC service primitive These functions are used to return information about the transaction and allow the MAC layer to communicate with the upper layer void mlmeAssociatelndication ADDRESS deviceAddress BYTE capabilityInformation BOOL securityUse UINT8 aclEntry void mcpsDatalndication MCPS DATA INDICATION pMDI void mlmeRxEnableConfirm MAC ENUM status void mlmeBeaconNotifyIndication MLME BEACON NOTIFY INDICATION pMBNI void mlmeCommsStatusindication WORD BYTE srcAddrMode ADDRESS pSrcAddr BYTE dstAddrMode ADDRESS pDstAddr BYTE status void mlmeDisassociatelndication QWORD deviceAddress BYTE disassociateReason BOOL securityUse BOOL aclEntry void mlmeDisassociateConfirm MAC_ENUM status void mlmeOrphanindication QWORD orphanAddress BOOL securityUse BOOL aclEntry void mlmePollConfirm MAC ENUM status void mlmeRxEnableConfirm
70. r further information please refer to the FPL Flash Programming user s manual UM U17587EE1V0UM00 CHAPTER3 SAMPLE PROJECT INSTALLATION 3 4 3 2 Debugger setting The debugging of the application using the Release It board uses the on chip debug feature of the 78F0148 device For debugging set the output format to C SPY and the debugger driver to Minicube The 10 78f0148h ddf file must to be selected in the device description area For debugging using the NEC Debugger ID78KO QB the output file has to be a xcoff78K for further information about how to set and use the NEC Debugger please refer to the relative appendix at the end of this document and to the software user s manual The use of the on chip debug feature with the Release It board required IAR C SPY debugger simulator For further information refer to the IAR Systems Embedded Workbench for 78K0 78KOS user s manual Options for node NEC Zigbee FFD Release X Category Factor Settings General Uptions C C compiler Output Extra Output Hdefine Diagnostics List Config Processing Assembler Custom Build Output file Override default Secondary output Debugger MEL 2 FFD d2b None for the selected Format Emulatar 78 Format simulator Debug information for C SP Y IEC Pak with runtime control modules MIL Pak z with D emulation modules 7 Buffered terminal output C
71. rdinator this includes both FFD and RFD devices Point to point C Full function device Communications flow 16 UM U17587EE1V0UM00 CHAPTER1 INTRODUCTION Figure 2 Peer to Peer Topology In a Peer to Peer network devices can communicate directly with each other however this is only possible if the devices are FFD It is not possible for an RFD device to communicate directly with another device an RFD device can only communicate with a coordinator In a peer to peer network you still must have a coordinator Both network topologies maybe combined to form a Cluster tree network which will allow for the building of complex network structures such as Mesh networks etc Cluster Tree Example Clustered stars for example cluster nodes exist between rooms of a hotel and each room has a star network for control C Full function device Communications flow C Reduced function device Figure 3 Cluster Tree Topology UM U17587EE1VOUMOO 17 CHAPTER1 INTRODUCTION 1 2 Two physical device types for the lowest system cost To allow vendors to supply the lowest possible cost devices the IEEE standard defines two types of devices full function devices and reduced function devices Full function device FFD e Can function in any topology e Capable of being the Network coordinator e Capable of being a coordinator e Can talk to any other device e Reduced function device RFD e Limited to star topology
72. red terminal Allow GSP yspeciic esta cutout Other Output Format intel estended Format variant None Module local symbols Include all Figure 21 Output project option UM U17587EE1VOUMOO 41 CHAPTER3 SAMPLE PROJECT INSTALLATION The FPL FLASH Programming software is Windows based software provided with the Release lt kit in the directory FPL of the CDROM It allows the user to select and download application programs to NEC microcontroller for evaluation purposes Note 42 Device View Help gt gt Flash Open gt gt ParameterFile Heading Success Head ParameterF ile gt gt LoadFile Headina Success read HEX gt gt COMMAND LoadFile D pent Cancel Load File gt gt COMMAND LoadFile Open Success read aL BR Figure 22 FPL GUI window iB x Firmi Version Ext ade Vendor Parameter file Mame 8FO146HD Format 0412 Version WT OG Processor Ver 0200 Load file Mame ZIGBEE FFD HE Date 2005 05 03 13 10 08 Lhksum Z8BD hB Area QO0000h 00E FFFA Connector to device Speed 9600 vdd Freq 16 00 Multiply Refer to the FPL installation document and user manual to flash Intel extended files into an NEC microcontroller Port Soeed Frequency Multiply rate Parameter file and Load file have to be set before programming Fo
73. ress allocations The definition of these addresses short coord address associated devices address etc are parts of the applications and have to be transmitted to the MAC layer see modify attribute in the application code Libraries are provided with 3 header files The libraries can not be used without the header files For correct use of libraries refer to the application code or to the section 3 Application Programming Interface or the IEEE802 15 4 standard The application code consists of six C files and one header file 4 6 1 Low Level Init This function deals with the low level hardware initialisation It manages the main clock the watchdog timer and the IXRAM initialisation 4 6 2 Init Application hardware peripherals initialisation In this file are initialised the port 7 for joystick and switch input port 4 for the LEDs output and the timer HO for adding delay and timer 50 for periodic joystick reading 4 6 3 Joystick App Timer 50 interrupt service routine return the joystick position Used by the application to display the LED pattern 4 6 4 Control LEDs Is defined in this file an idle loop using timer HO to add delay and LED rolling functions as the function that switches the LEDs regarding the joystick position 4 6 5 UART Transmission In this file are defined functions regarding the serial interface UART6 These function are e nitialisation of the serial interface UART6 e Enable
74. rocessor Diagnostics Assembler Custom Build Include paths one per line TOOLKIT DIRSAINCA zen DIRSMNCSCLIB E PROJ DIR SS s SAPPLICATIDNSDEMOSAMPLESINCLLIDES 8 FROJ DIRS s SLIBRARIESSHEADER FILE IECLIBE Defined symbols per line Simulator as PT_FFD Preprocessor output to file Preserve comments Generate Hine directives Figure 20 Include path project option 3 4 2 Defined symbols Both projects require include paths for the application and library s header files The add of defined symbols is required by the application only MAC OPT FFD defines symbols only compliant with the FFD library This allows call to any MAC primitive and have all the features of a full function device An application project based on this sample which uses the FFD Library without this defined symbol will produce code for a reduced function device providing the same result as a project using the RFD library An application project based on this sample which uses the RFD Library must not use the defined symbol MAC OPT FFD which allows the application code to call to MAC primitives only available with the FFD library as the primitive mlmeStartRequest The RFD library could be used for a device node project which will never need to set its own network This allows reduction in the size of the MAC stack code 40 UM U17587EE1VOUMOO CHAPTER3 SAMPLE
75. s done for code size and performance purposes Other request functions such as mcpsDataRequest which will not return immediately will return the confirm value through calling a function such as mcpsDataConfirm which must be defined by the layer above the MAC For these functions it is recommended that the upper layer returns control to the MAC sublayer as soon as possible i e that further processing of the incoming data is done outside the callback function 6 2 3 Indication The indication primitive is passed from the MAC sublayer to the upper layer to indicate an internal MAC event that is significant to the upper layer This event may be logically related to a remote service request or it may be caused by a MAC internal event Indication primitives are generated as function calls called by the MAC layer The upper layer must define the functionality of each indication primitive As with confirm primitives it is important that the upper layer returns control to the MAC sublayer as soon as possible Processing of the data generated by indication function calls should be done outside the function itself e g by setting a flag which is polled by the higher layer 6 2 4 Response The response primitive is passed to the MAC sublayer to complete a procedure previously invoked by an indication primitive UM U17587EE1VOUMOO 59 CHAPTER6 APPLICATION PROGRAMMING INTERFACE FOR RELEASE IT PLATFORM 63 MCPS SAP The MCS SAP is the Servic
76. s for node Zigbee FFD Release General Options L compiler Assembler Custom Build Linker Debugger 78 IECLIBE control modules Simulator F emd atan Moc es MG oi p o E compatible usp Include all Figure 36 ID78K0 QB Debug output project option UM U17587EE1VOUMOO CHAPTER 7 APPENDIX NEC DEBUGGER INSTALLATION AND USE To start debugging the application choose program P gt Tools32 gt ID78KO0 TK It is also possible to start this software from the IAR Systems Embedded Workbench for 78 0 78 05 by setting the gt Tools gt Configuration Tools as it is showing by the foolwing figure Configure Tools Menu Content NEC ID78KD TE Debugger Cancel Mew Remove Menu Text Command MEL Toolz3z BIN dk 3zmtk2 exe Browse Argument Initial Directory Redirect to Qutput Window Prompt for Command Line Tool 4vailable Always Figure 37 IAR Configure Tools option 76 UM U17587EE1V0UM00 7 APPENDIX NEC DEBUGGER INSTALLATION AND USE To set the NEC Debugger choose the appropriate uPD device name Configuration ail IL 1 ieee peg ao E X L P I Fere ent a fora
77. s selected and transmitted from either board In this application the packets sent are communicating the LED pattern between each evaluation board 4 2 Serial data transmission This application uses a Hyperterminal window as a user interface This allows entry of any string of ASCII and to transmit it to the other board in the network also linking to a Hyperterminal window The host PC is connected to the Release It board using an USB cable Each ASCII character is directly transmitted and stored in a memory buffer of 28 bytes The carriage return code denotes the end of the string and requests the system start a transmission task This will allow creation of a chat star network where endpoint devices could talk with the network coordinator In this application the packets send are communicating the ASCII string between each evaluation board 4 3 Initialisation Note The switches available on these boards provide different functionalities at different stages of the application On power up the evaluation boards are initialised and then wait for user input The Power LED will light up showing that the board has power and the system is running No other indicators are provided Note Depend on the battery jump setting Release It kit could be powered by USB interface no separate power supply is needed or by 9V Battery The USB interface provides the Helease It board with 5V supply voltage At this stage the switches provide the following funct
78. ss personal area network LR WPAN UM U17587EE1VOUMOO ACL BE BER BPSK BSN CAP CCA CFP CID CRC CSMA CA CTR CW DSN ED FCS FFD GTS IFS LAN LPDU LLC LR WPAN LSB MAC MCPS MAC MCPS SAP MAC MIC MLME MAC MLME SAP MAC MSB MSC MPDU MAC MSDU MAC NB PAN PD SAP PHY PDU PER PIB PAN PLME Acronyms and abbreviations access control list backoff exponent bit error rate beacon interval beacon order binary phase shift keying beacon sequence number contention access period clear channel assessment contention free period cluster identifier cyclic redundancy check carrier sense multiple access with collision avoidance counter mode contention window length data sequence number energy detection frame check sequence full function device guaranteed time slot interframe space or spacing local area network protocol data unit low rate wireless personal area network least significant bit medium access control common part sublayer common part sublayer service access point message integrity code sublayer management entity sublayer management entity service access point most significant bit message sequence chart protocol data unit service data unit number of backoff periods personal area network data service access point protocol data unit packet error rate information base physical layer management entity UM U17587EE1VOUMOO PLME SAP POS P
79. ssociation The format of aggregated bits from a medium access control MAC sublayer entity that are transmitted together in time A device capable of operating as a coordinator or device and implementing the complete protocol set One of a variety of channels on a physical link A device that has lost contact with its associated personal area network PAN coordinator A coordinator that is the principal controller of a personal area network PAN An IEEE 802 15 4 network has exactly one PAN coordinator The contents of a data message that is being transmitted The unit of data exchanged between two peer entities The format of aggregated bits that are transmitted together in time across the physical medium The space about a person or object that is typically about 10 m in all directions and envelops the person or object whether stationary or in motion A group of security operations designed to provide security services on medium access control MAC frames UM U17587EE1VOUMOO Service data unit SDU Transaction Wireless medium WM Information that is delivered as a unit through a service access point SAP The exchange of related consecutive frames between two peer medium access control MAC entities required for a successful transmission of a MAC command or data frame The medium used to implement the transfer of protocol data units PDUs between peer physical layer PHY entities of a low rate wirele
80. ssociation with a short device MAC is implemented according to IEEE std 802 15 4 but disassociation from the coordinator with the device having a short address does not work Transaction persistence time The current MAC release has a maximum value for the MAC TRANSACTION PERSISTENCE TIME pib attribute value of 32767 in stead of 65535 specified Code size optimisation The MAC PHY sublayer is not yet fully code size optimized UM U17587EE1VOUMOO 97 CHAPTER 6 APPLICATION PROGRAMMING INTERFACE FOR RELEASE IT PLATFORM This section describes how to use the EEE 802 15 4 MAC SW library supplied with the Release lt kit The software is for use with the NEC 78K0 microcontroller family and the Chipcon CC2420 2 4Ghz wireless transceiver Functionality of the of the MAC and PHY layer software includes CSMA CA e Link Quality Measurements e Data Transfer e Security e Retransmission e Frame Acknowledgement e Association e Disassociation e Beacon notification e Orphaning e Receiver control e Power control e Channel scanning energy active Passive e Communication status reporting e MAC attribute access e Starting networks e Synchronize to networks e Polling data Also supplied are example applications showing how to use the SW library of which the full source code is supplied 58 UM U17587EE1VOUMOO CHAPTER6 APPLICATION PROGRAMMING INTERFACE FOR RELEASE IT PLATFORM 6 1 Introduction NEC
81. st system via USB interface cable The USB host interface enables communication to the Release It board The USB UART chip FT232 allows application software to access the USB device in the same way as it would access a standard RS232 interface The FTDI s Virtual COM Port VCP driver appears to the windows system as extra Com Port in addition to any existing hardware Com Ports Chat transmission through the UART HyperTerminal or other available PC based communications programs can be used communicating through FTDI VCP drivers with virtual COM port The both nodes have to be connected to a host PC to enjoy this application HyperTerminal setting The protocol used for the chat application is a standard RS232 protocol 38400 bits per second 8 bits of data no parity 1 bit stop and no flow control The completed HyperTerminal setting required is showed in the different figures below UM U17587EE1VOUMOO 47 CHAPTER 4 APPLICATION DESCRIPTIONS AND OPERATIONS Zighee Board Properties Connect Settings Function and keys act as x Terminal keys Windows keys x Backspace key sends x Del Ctl H Space Ctrl H x Emulation vri Terminal Setup Telnet terminal ID vri 00 Backecroll buffer lines 500 Play sound when connecting disconnecting Input Translation ASCII Setup Cancel Figure 25 HyperTerminal Port Connection Zigbee Bo
82. ther liability arising from the use of such products No license express implied or otherwise is granted under any patents copyrights or other intellectual property rights of NEC Electronics or others Descriptions of circuits software and other related information in this document are provided for illustrative purposes in semiconductor product operation and application examples The incorporation of these circuits software and information in the design of a customer s equipment shall be done under the full responsibility of the customer NEC Electronics assumes no responsibility for any losses incurred by customers or third parties arising from the use of these circuits software and information While NEC Electronics endeavors to enhance the quality reliability and safety of NEC Electronics products customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely To minimize risks of damage to property or injury including death to persons arising from defects in NEC Electronics products customers must incorporate sufficient safety measures in their design such as redundancy fire containment and anti failure features NEC Electronics products are classified into the following three quality grades Standard Special and Specific The Specific quality grade applies only to NEC Electronics products developed based on a customer designated quality assurance program for a specific application
83. ty of the higher network layers to develop this procedure and determine if the association request is acceptable Parameters mlmeAssociateIndication ADDRESS deviceAddress Address of the device requesting assoctiation BYTE capabilityInformation Bitmap of capabilities BOOL securityUse Use security TRUE or FALSE BOOL ACLEntry TRUE or FALSE sender in ACL table 6 4 3 MLME ASSOCIATE Response mlmeAssociateResponse procedure is used to reply to an association request from a device wishing to join the network This procedure is executed by the coordinator Parameters mlmeAssociateResponse ADDRESS pdeviceAddress Pointer to the extended address of the associated device WORD AssocShortAddress The assigned short address MAC_ENUM Association status BOOL securityEnable Security enabled TRUE or FALSE 6 4 4 MLME ASSOCIATE Confirm The mlmeAssociateConfirm procedure is called buy the MAC layer when the association procedure has completed This procedure is used on the device and is used by the higher layers to determine if association has been successful 62 UM U17587EE1VOUMOO CHAPTER6 APPLICATION PROGRAMMING INTERFACE FOR RELEASE IT PLATFORM Parameters mlmeAssociateConfirm WORD assocShortAddress The short address given by the coordinator if any MAC ENUM Association status j 6 4 5 MLME DISASSOCIATE Request Used by an associated device to indicate leaving a wireless PAN or by a
84. urity Service Provider Application Support Sub Layer ZigBee Network Layer MCPS jm MLME 802 15 4 MAC IEEE 802 15 4 PHY Figure 8 Zigbee stack The new ZigBee protocol interfaces directly to the IEEE 802 15 4 MAC layer via the MCPS and MLME primitives normally called a SAP Service Access Point This is clearly defined in the IEEE 802 15 4 standard and it is these access points that are used in the demonstration applications The ZigBee protocol adds the additional functionality of network joining and leaving routing across multiple networks security key management and application profiles and support UM U17587EE1VOUMOO 21 CHAPTER 2 LIBRARY INSTALLATION AND USE The NEC IEEE 802 15 4 software library consists of three major functional components MAC sublayer primitives PHY layer primitives and Chipcon transceiver device drivers MAC 78KO0 Lib C object file libraries for NEC s 8 bit microcontrollers They are built using the IAR Embedded Workbench for NEC 78K0 and 78KOS microcontrollers These libraries are fully compliant with the IEEE 802 14 2 standard The libraries handle frame transmission and reception network association and disassociation and beacon superframe structures for network time synchronisation and guaranteed time slot GTS anda mechanism for high priority communication not supported yet The application layer has to define the network topology security features and applicat
85. work communications When set as a Coordinator the following occurs A start request is called to create a new network by providing network configuration e A no beacon network is then established e If this is successful then the LED s on the board will indicate this with LED 1 2 3 ON The coordinator can now respond to any scan requests made by any node The settings and PAN description will then be transmitted The program will now enter Run Mode ready for the main application to be used 4 4 Run Mode Once the network association types are chosen on each board the application enters into standard Run Mode They are then ready to receive input from the user 4 4 4 Run functions At this stage the switches provide the following functions SW6 RESET SW2 Selects to Disassociate from the Network SW3 Selects to Transmit data to the other board 46 UM U17587EE1VOUMOO CHAPTER 4 APPLICATION DESCRIPTIONS AND OPERATIONS At this stage the Joystick is now active and provides the following functions Table 2 Joystick Position Table P40 P41 P42 P40 P41 P42 0 1 O P40 P41 P42 om Up P40 P41 P42 1 1 0 P40 P41 P42 111 Centre At this stage the UART port is now initialised and active This function allowed to a Host PC terminal software for communication with Demo Network The UART port is connected to a FTDI USB to RS232 Interface Chip The Release lIt board is connected to the ho
Download Pdf Manuals
Related Search
Related Contents
ESI Feature Phone User`s Guide ClearSounds A55 User's Manual 操作ガイド(PDF Samsung AR09HSFSCWKXSK Kullanıcı Klavuzu User Manual - Princess Auto Copyright © All rights reserved.
Failed to retrieve file