This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2430 GPIO coding

Other Parts Discussed in Thread: Z-STACK, CC2430, CC2520

I am developing an application with a CC2430 designed into a custom PC board, and am using Z-Stack 1.4.0. My question is whether there is a better way to write code for I/O from all the CC2430 GPIO pins, other than using the HAL Driver API functions for 'Key Service' and 'LED Service', and modifying them for the other GPIO pins. I haven't been able to find anything in the TI documentation pertaining to this. I would think that there are API functions addressing this, since most people would be using CC2430s in other than a CC2430EB or CC2430DB. I would appreciate any help, as I am new to Z-Stack and CC2430.

 

  • Hi,

    I'd like to recommend that you upgrade to z-stack 1.4.3-1.2.1 as soon as possible since there has been numerous bug fixes since 1.4.0.
    Here's a code example that sets P0.2 high:

     P0SEL &= ~BV(2);  // set P0.2 as GPIO pin
     P0DIR |=  BV(2);  // set P0.2 as output
     P0    |=  BV(2);  // set output high

    More information on I/O configuration (including use of peripherals can also be found in the 2430 datsheet)

    Hope this helps.

  • Hello Z,

    Thanks for the reply, and it will help me get into this. I found the elements you are using in this code in the 'Peripherals, I/O registers' section of the 2430 datasheet, and the defines in hal_defs.h. I also found a similar usage of this same code in Serialize.c. Is there anywhere that these type of code examples in the Z-Stack are grouped to be able to reference?

    Also, regarding your suggestion to upgrade the Z-Stack version, I was told by TI that they are now up to Z-Stack 2.1.0, but unfortunately the Workshop literature is only up to Z-Stack 1.4.0. I am hesitant to move to a version that is not compatible with the labs which I can use to build on. What types of bugs are you referring to, and how severe do you feel the impact will be of working with 1.4.0? Thanks. 

  • Wireless1 said:

    Thanks for the reply, and it will help me get into this. I found the elements you are using in this code in the 'Peripherals, I/O registers' section of the 2430 datasheet, and the defines in hal_defs.h. I also found a similar usage of this same code in Serialize.c. Is there anywhere that these type of code examples in the Z-Stack are grouped to be able to reference?


    I would assume these examples are in the .\Components\hal directory for accessing peripherals, GPIO, etc.


    Wireless1 said:

    Also, regarding your suggestion to upgrade the Z-Stack version, I was told by TI that they are now up to Z-Stack 2.1.0, but unfortunately the Workshop literature is only up to Z-Stack 1.4.0. I am hesitant to move to a version that is not compatible with the labs which I can use to build on. What types of bugs are you referring to, and how severe do you feel the impact will be of working with 1.4.0?

    If you are using the CC2430, which earlier in this thread you did mention, I would think you should stick to the v1.4.x line of Z-Stack software.  It seems this is based on the CC2430 family.  The v2.1.x appears to be geared for the CC2520+MSP430 architecture.
    The v1.4.3 Z-Stack software deliverable does have a document that discusses upgrading from the v1.4.2 to v1.4.3.  I don't believe it discusses v1.4.0 to v1.4.3 however.

  • @ Wireless1:

    The best place to look for peripheral access code examples would be in the hal drivers. In the z-stack 1.4.3 release there is a document called "Z-stack HAL porting guide" that talks about the related files.
    1.4.0 is a few evolutions behind. We've made improvements in the low level MAC and at the network layer (routing, etc). There have also been code size reduction benefits due to the move to the 7.30B IAR compiler. You'd be able to run the labs on 1.4.3, but you'd have to move your files over to the new codebase. We also redesigned the ZDO callback interface to the application from 1.4.2 to 1.4.3, so how the application handles this is going to be different.

    @ BrandonAzbell:

    You're correct on all accounts. We've had porting guides in the different stack releases, basically going from 1.4.0->1.4.1, 1.4.1->1.4.2, 1.4.2->1.4.3. It's simpler really to just start with a 1.4.3 sample app codebase like GenericApp.

  • Actually I've just uploaded some porting documents since 1.4.0 to my files section if anyone is interested.

  • Hi Z,

    I looked at the Z-Stack HAL Porting Guide that you mentioned, and it will be very helpful. It looks like it will apply to Z-Stack 1.4.0 as well. You menitoned that you uploaded porting documents to your files section, but I don't know how to access that, so please let me know.

    I have another question: I am going to be running a ZigBee network with as many as 40 of our custom boards, each of which will have a CC2430 on it. In Lab6A, page 6-15, there are several #defines. I would like to know whether I need to set any or all of these #defines in the actual system. Do I have to set anything else beside the PAN ID in f8wConfig.cfg, as described on page 6-16? Also in this lab, it says to note the ID number of each EB and DB. I want to know where that is used? Looking at the source code, I see in Lab6.h, a #define for LAB6_DEVICEID, and maybe that is where it should be used.

    Thank you.

  • Hi Wireless1,

    you can access the files from "Z" over his/her profile (https://community.ti.com/members/611578/default.aspx) in the section "My files"

    Cheers. Flo

  • If anyone can respond to the second question in my posting of of 10/22, I would apperciate it. I'll copy what I wrote:

    I have another question: I am going to be running a ZigBee network with as many as 40 of our custom boards, each of which will have a CC2430 on it. In Lab6A (of the TI ZigBee Workshop Student Guide), page 6-15, there are several #defines. I would like to know whether I need to set any or all of these #defines in the actual system. Do I have to set anything else beside the PAN ID in f8wConfig.cfg, as described on page 6-16? Also in this lab, it says to note the ID number of each EB and DB. I want to know where that is used? Looking at the source code, I see in Lab6.h, a #define for LAB6_DEVICEID, and maybe that is where it should be used.

    Thank you to anyone who can respond to this.

     

     

  • These defines are used to populate a Descriptor table which is ultimately used by the Application Framework (AF) interface layer in the ZigBee stack.  Refering to the Z-Stack API F8W 2006-0021.pdf documentation (in the Z-Stack v1.4.3 software tree), Section 3.2 indicates this structure is used to define the Simple Descriptor which each endpoint must have a ZigBee Simple Descriptor.  The descriptor describes the endpoint to the rest of the ZigBee network.  Another device can query another endpoint for its simple descriptor and determine what kind of device it is.

    Some of the parameters which are #define variables in the Lab6 are to be obtained from the ZigBee Alliance.

    So yes, I would say these are needed in an actual system.

  • Brandon,

    Thank you for the response.

    I see in the Z-Stack API F8W 2006-0021.pdf that AppProfId and AppDeviceId are to be obtained from the ZigBee Alliance, but in the labs and samples, a value of 0x0F04 is used for AppProfId, and 0x0001 for AppDeviceId. Can I use these values in my system, and if not, how to I obtain the right values to use?

    Also, in Lab6, part C, it shows how to bind the Coorinator to the other devices manually. Is there a way that all devices can be bound to each other automatically with no user action?

    Thank you.

  • Wireless1 said:

    I see in the Z-Stack API F8W 2006-0021.pdf that AppProfId and AppDeviceId are to be obtained from the ZigBee Alliance, but in the labs and samples, a value of 0x0F04 is used for AppProfId, and 0x0001 for AppDeviceId. Can I use these values in my system, and if not, how to I obtain the right values to use?


    I really don't have any information about the values used in the lab regarding if they are valid ZigBee Alliance profile/device id values or just numbers used for demonstration purposes.
    Regardless, I believe you will need to get appropriate values from the ZigBee Alliance directly.  See link below.
    http://www.zigbee.org/en/join/membership_requirements.asp

    Wireless1 said:

    Also, in Lab6, part C, it shows how to bind the Coorinator to the other devices manually. Is there a way that all devices can be bound to each other automatically with no user action?


    Yes, the Student Guide for the Workshop provides an illustration of automatic binding.

  • The boards numbers on the EB and DB development boards are hard-coded indentifiers in the USB interface. Thay have nothing to do with the ZigBee stack.

    There are no HAL defined GPIO APIs. Modifying the LED APIs is the shortest path to get them.

    The profile ID, cluster ID, etc used in the workshop labs were picked out of thin air. They are not "real" ZigBee Alliance assigned numbers ... they are for development purposes only. In order to obtain "real" manufacturer specific profile ID numbers, you will have to join the ZigBee Alliance and apply for them. So yes, you can use them for developing your project, but I would certainly not use them in a real product. There would be no guarentee that someone else would also be incorrectly using that profile ID ...

    Yes, you can certainly use something like automatic binding to bind two devices together with no user intervention at all. Once bound though, you might want to think about the use of NV_RESTORE. That will store the binding table in non-volatile memory so that the devices can simply restore their previous binding rather than re-bind at every power up.

     

    Scott

  • Scott (or anyone),

    Thank you for the answers to my previous questions.

    I still have a question regarding automatic binding. Although Lab 6C in the Workshop has an example of this using ZDApp_AutoFindDestination(), it only binds the routers and end devices automatically. Is there a way to also use ZDApp_AutoFindDestination() to automatically bind the coordinator to the network so that it can also send data to other devices, without having to manually bind it? If not, is there another way to do it, so that any device can send data to any other device, without manual binding?

    Thank you.

  • It is my understanding that a coordinator is a router, but has the unique characteristic of starting the network, among I'm sure a couple of other things.
    Therefore, I don't see why an automatic bind can not happen with the coordinator.

  • Does anyone know whether what Brandon says is correct? If so, after the Coordinator is powered up, followed by all the other devices in any order (assume they are all routers, and some require multiple hops to reach the coordinator), that the network will be formed and binding occur, so that messages can be sent from any device to any other device?

     

  • The workshop material I sent you shows this process in detail. A Coordinator is basically a Router, with the additional ability to start a network from scratch. The Coordinator will scan the allowed channels for the lowest energy, beacon request each channel to see if there are any other networks out there, then select the best channel to operate on based on the lowest energy and fewest existing networks.

    The Coordinator should start first (otherwise the other devices will just keep beaconing it) followed by the other devices in any order. Network association happens first, followed by binding.

    You can completely automate the binding process by changing the ZDO coding (this is what it's intended for) to whatever your application requires. Binding ties applications (on endpoints) together so that they can send data to each other. THis is different from network association, where Routers can route messages through the network.

     

  • @Wireless1:

    Hi Wireless1, what Brandon said is correct. A coordinator also has router functionality, but its special role is to act as the PAN coordinator (start up the network) as well as as the trustcenter of the network (if using security).
    When you use end device binding, it also acts as a gatekeeper to determine whether there is a match for the end device bind requests or not. If there is a match, it will send back to the source device the endpoint and destination address
    of the requestor. The source device will then create a binding entry. This process is what is known as end device binding (or aka manual binding, source binding). This is SW2 version of binding in the labs. I know this terminology of "end device
    binding" is confusing, because it's not just end devices that can use this method of binding.

    Binding could also be done via match descriptor request (this is SW4 method of binding in the labs. The device that wants to bind with someone sends out a "personal ad" saying it has X cluster IDs on Y endpoint, using application
    profile ID Z. A device that has matching clusters on that profile and on that endpoint will respond with a match descriptor response. It is up to the application then to save that response and build a table of destination addresses and endpoints.
    The sample app only saves the last response, which is why if you have multiple devices that can respond, you will only be able to talk to one of the devices, not all.

    There is also the manual way which is to query each node for the simple descriptor. Within the simple descriptor you can sort through the endpoint, profile ID and list of clusters to determine which device(s) support the clusters you want to exchange.

  • Scott (or anybody),

    I may not be able to guarantee the the Coordinator will start first, since the 2.4GHz channel for all devices is going to be turned on and off automatically in the system. If other devices keep beaconing it, will the network form once the Coordinator starts? Is there a timeout for the ZDApp_AutpFindDestination function, and if so, can I repeat it periodically until binding occurs?

    In your 10/28 post you said I can use the NV_RESTORE compiler option to not have to rebind at every power up. If I want to use this feature, can I turn on the devices in the correct order to establish the binding I want, and have it stored in NV memory, for future startups? Where is a description of the procedure for accomplishing this? I only found in the Z-Stack User's Guide, a description in section 6.3 which I copied below.

    If the devices are not reset, but the 2.4Ghz channel on each of them is turned off, and then some time later, turned back on, will this NV_RESTORE allow the binding that I had setup with proper device turn on sequence, and stored in NV memory, allow the network to operate after the 2.4Ghz has been turned back on for each device, in any order?

    I also have a question about Lab6B. In step 7, when the router and end device are sending periodic data frames to the coordinator, I see on the Packet Sniffer that the router 'Source Address' is 0x0001, and the end device 'Source Address' is 0x796F, and these stay the same if I restart the network. I searched through all the application and Z-Stack code, and did not find '796F' in any file. I think these are probably the 'short address' values, but I don't know where they are generated.

    Thank you for your assistance.

     

    6.3. Non-Volatile Memory Once a device has been setup, the 64-bit address has been set, and started operation as a coordinator or has associated to another device, it will save its operating state in non-volatile (NV) memory. When the device is restarted (reset or power on), it will normally use this saved operating state to resume operation at its previous state. Inclusion of the NV restore function in a program is controlled by the NV_RESTORE compile flag in the project files.

     

     

     

  • You must remember that network formation and binding are two separate processes. Beaconing is part of the network formation process. Once network formation is complete, binding can occur. For the binding process, you can modify the ZDO to wait as long as needed for binding to complete. If you add the NV_RESTORE compile option to your build, the stack software will store the short address, binding and routing tables in NV memory so those processes do not have to run every time the network powers up. If you cannot control the start up order, you may need to lengthen the "orphan" time so that the devices don't assume their parents are lost (when they are just powering up). You have cited the correct part of the user's guide.

     

    I lab6b, reference the CSKIP short address diagram. 0x0000 is the short address for the Coordinator, 0x0001 is the first Router joined to the Coordinator and 0x796F is the first End Device joined to the Coordinator. Devices will always try to join as "high" on the tree as possible, until that parent is "full". Of course, if you switch everything on at once, collisions may cause devices to join up in a non-optimal fashion ... which is no real problem. Short addresses are only indicative of routing paths if nothing is mobile (Coordinators and ROuters should not be mobile)

     

     

  • Scott,

    I searched through several documents, including the Workshop manual, the ZDO Programmer's Guide, ZDO API manual, Z-Stack API manual, and could not find any parameter, etc that looks like it would control the "orphan" time.

    I am having difficulty with this, and am running out of time to be able to implement a basic network scheme. Please let me know how I can accomplish the following:

    1. I will have a network with a Coordinator and many Routers, which will need multiple hops to reach the Coordinator. I just need to be able to send data messages from the Coordinator to each Router, and from each Router to the Coordinator. I do not need to be able to send data messages from Router to Router.

    2. I need to be able to have devices turn on in any order, and after all are on, to have it form a network with binding to be able to send messages as described in 1.

    3. I need to be able to have the 2.4GHz channel turned off on every device (but not power off the device), and then some time later, turned back on in any order, and have the network able to operate as described in 1.

    4. This all must be able to be done automatically, without manual intervention.

    5. If it makes it more feasable, I can determine the exact network structure of devices, which could be coded into each device.

    Is what I am describing fairly straightforward? I would like to use ZigBee / CC2430 for this, but I need help. Can you please give me detailed information to be able to implement this. Once I have this basic network operation, I will be able to design the necessary system operation, OSAL/HAL interfacing, etc. I understand that giving this type of support is not your priority, but there is a potential for a huge number of CC2430s to be ordered by us, if I can get this system working. Thank you for your understanding.

     

     

  • Without knowing a whole lot more about your application, all I can give you is answers to your individual questions. Your local TI salesperson (note: TI) can get the information from you and get the answers to you so that you can make an informed decision. You should pursue this path. But I'll take a shot at answering your individual questions:

    1) ZigBee does this easily. Take the GenericApp, program a Coord and multiple Routers and you've finished this step. Applications/Endpoints on each of the routers can then communicate with the Coordinator after binding .... this part is your programming effort.

    2) No problem. ZigBee does this easily. The orphaning process I mentioned will only caused the orphaned device to re-join the network. Again, binding is separate from network formation.

    3) I guess you're trying to turn off the radio. This would be easier in a MSP430/CC2520 or other two-chip implementation, but it can be done. Routers aren't meant to sleep, because they can't route while they are sleeping. But you can make it happen.

    4) Again, you can program this to happen without manual intervention. But you'll need to program it to happen.

    5) I don't know what this means.

    I don't understand anything about your application, or even that the solution you are driving towards is appropriate to it. I have helped many people whose limited ZigBee knowledge has caused them to design networks that can't work. Nothing you've mentioned is impossible, but none of it happens without effort. Definitely contact your TI person and get a dialog going. If you were attending my workshop, I'd help you design your network application on the whiteboard ....

     

    Scott

  • Scott,

    Thank you for the information.

    I am working late on this, and since my last posting, I have been able to get a Coordinator and a Router to form a network and auto bind to each other, when powered up in either order, even if there is a long time delay between their being powered up. Then they can send data messages to each other. I used GenericApp as the starting point for this. Now I have to be able to do this with a Coordinator and many Routers, and have the Coordinator be able to send unicast data messages to individual routers, and recognize which router sent any incoming message to the Coordinator. GenericApp gave me the ability to communicate between the Coordinator and one Router. To do this with many Routers, do I have to add a new Endpoint and Cluster for each Router sending/receiving data messages with the Coordinator? Please be as specific and detailed as possible. By the way, the TI rep I am dealing with is not knowledgeable about ZigBee software. Thanks again.

  • Scott,

    I have been thinking more about this, and due to the time urgency, I need to quickly be able to have a data message communication channel from the Coordinator to the Repeaters, and vice versa. To make it simpler, I can code individual device addresses into the APS payload that I send, so I don't have to have a separate logical channel for each repeater. Right now I only have bidirectional communication between the Coordinator and one Router. I need to have the Coordinator communicate with many Routers, and I need to implement this very soon. I can deal with addressing in my APS payload. Please help with this. I cannot stress enough the time urgency of this. Thank you.

     

  • A separate channel? Repeaters? Are we still talking about ZigBee?

    The mesh network operates on a single channel, although 2007 and PRO have frequency agility. Messages contain the senders short address already.

    Like I said in the previous message ... use GenericApp, program a Coordinator device, then program as many Routers as you like. They will all link up and be ready to implement your binding and data transmission programming.

  • Scott (or anybody),

    I wrote the last posting in a hurry. I meant to say Router, not Repeater.

    Am I understanding you correctly that if I program the Coordinator and all the Routers with the same code, without modifications, that I am using now for bidirectional data communications between these two devices, that I will have communication between Coordinator to all Routers and vice versa? Doesn't the Coordinator have to bind separately to each Router in the network to be able to send it data messages, and doesn't each Router have to bind separately to the Coordinator? Right now both devices are binding using ZDApp_AutoFindDestination. When the ZDO_NEW_DSTADDR is returned, the information for the GenericApp_DstAddr and GenericApp_epDesc is determined, and used as parameters for AF_DataRequest, when sending data messages. Doesn't the Coordinator need a different GenericApp_DstAddr and GenericApp_epDesc for each Router to which it needs to send data messages? I can see how each Router might be able to use the same code to be able to bind to and send data messages to the Coordinator. But it seems that the Coordinator code would not be able to bind with every Router (they probably would not be all turned on at the exact same time), and then be able to send data messages to all of them. Please let me know if my understanding is wrong. It would be very good if I could just use the same code for the Coorinator that I am using for one Router, without modification. Even if I was able to only send broadcast messages to all the Routers together, I could  use that, and just code individual addresses into the APS payload from the Coordinator. This does not have to be the most elegant solution, or take advantage of all the Z-Stack features, but I need something that I can use. Believe me, this is getting to the critical point. I need to get this basic communication implemented right away. Thank you.

  • Scott (or anybody),

    I was able to test and see that as I thought, I could have multiple Routers bind to the Coordinator without modifying the code. But the Coordinator code needs modification to be able to bind to multiple Routers. Please give me as much information as you can to help me know what I have to modify in the Coordinator code to do this. Thank you.

     

  • Once you've got the network running with a Coordinator and all of your Routers, you need to modify the binding process. In the GenericApp sample application and lab files, the binding process is initiated using the joystick. In these sample applications, the binding was intended to be between an End Device and a Router, so if/defs were used in the code to exclude the Coordinator. Carefully look at the code that is run by the switch handler case statement to find the binding type you want to use.

    Binding is between applications. Applications run on Endpoints. Endpoints must have a series of Descriptors. The binding process matches these descriptors to produce a binding, which the sender saves in its binding table. Binding can be one to one, many to one or one to many ... the size of the binding table limits how many that is. Imagine a single light switch controlling an entire building's lighting system as an example of one to many.

    So, one could envision a network containing a Coordinator and multiple Routers in a ZigBee mesh network. The Coordinator would have a single application running on a single endpoint (in addition to the ZDO). This application would have a single input cluster and a single output cluster. Each Router would have a single application running on a single endpoint (in addition to the ZDO). This application would have a single input cluster and a single output cluster. The descriptors for these applications would have to match to produce a binding when requested.

    After Binding has completed, each Router could send data to the Coordinator and the Coordinator could send data back to the sending Router by extracting the senders' address from the incoming message. MAC level acknowledgements would happen automatically and, if selected, application level acknowledgements could occur too. Any device could message ALL device using the broadcast address mode.

    I hope this points you in the right direction.

  • Scott,

    The GenericApp that came with the Z-Stack does not have if/defs to exclude the Coordinator, so maybe you have a different version. I put the source files in My Files for you to look at. As I said, I can form a network with a Coordinator and multiple Routers. I can bind all the Routers to the Coordinator, so each of them can send data messages which are received by the Coordinator. I need to be able to  bind the Coordinator to each of the Routers to be able to send data messages from the Coordinator to them. Either being able to send unicast data messages to each of them, or broadcast data messages to all of them would be sufficient. I don't need to turn on switches or read inputs from remote devices. I just need to be able to send data messages. Please look at GenericApp.c and let's assume that I have 20 Routers in the network, which I can program with whatever I need in GenericApp.h. Can I code the Coordinator to bind with each of the Repeaters when everything is powered up and send data messages to them? Please tell me specifically what I have to add to the Coordinator code to do this. Do I need to have a separate GenericApp_DstAddr for each of the 20 routers? Please be specific. I can learn the theory of this as I go on, but it is urgent that I am able to implement this basic communication now. I also put the file MessageDemo, which I modified from GenericApp.c, to auto bind with a Coordinator and 1 Router, and send 16-byte data messages both ways, initiated by SW1 on either of them. It will also allow multiple Routers to bind and send data messages to a Coordinator. Thank you for your help.

     

  • I'm in the middle of a development project myself, so I'm sorry, but I can't debug or write your code for you. I've told you as much as I can in my previous posts without reaching that level.

    Getting 20 Routers bidirectionally bound and transferring data to a Coordinator isn't a trivial task, and unless you've budgeted the time to really understand how this stuff works, I suggest you contact a third party developer listed on the developer's network on www.ti.com/zigbee.

  • To anyone who has experience with Z-Stack coding:

    Is there anyone who has coded a ZigBee network where the Coordinator has bound to multiple Routers, to be able to send data messages to them (either broadcast or unicast)? I am not looking to have someone debug or write code for me, and I have been able to auto bind multiple Routers to the Coordinator and have each of them able to send data messages to it. But I do not know how to bind the Coordinator to more than 1 Router, to be able to send data messages. It would be greatly appreciated if you could at least help me to understand what elements are needed to be added to the Coordinator code to be able to bind to multiple Routers, just to be able to send data messages to them. For instance, from what I have learned, I would think that I would need a separate afAddrType_t for each Router that the Coordinator will bind to, which will be used in AF_DataRequest for the dstAddr parameter for each Router. Is that correct? If I just want to send broadcast messages to all the Routers in the network, can I use an address mode (DstAddr.addrMode) of 'afAddrBroadcast' for the dstAddr parameter structure? If I can do that, what would I have to put in for DstAddr.endPoint? What type of binding do I have to do with the Coordinator to just be able to send broadcast data messages to all the Routers? There are no samples in the Z-Stack documentation or Workshop labs showing a Coordinator sending data messages to multiple Routers, so any information, or sample code that you have, would be greatly appreciated.

     

  • Hi Wireless1,

    In order to send any unicast message, you need to fill out the parameters in the destination address declared as type afAddrType_t.
    Here's an example of how this structure would be populated if I wanted to send a unicast message to the coordinator:

    afAddrType_t destAddr;
    destAddr.addrMode = afAddr16Bit;
    destAddr.addr.shortAddr = 0x0000;
    destAddr.endPoint = TESTAPP_ENDPOINT;

    The coordinator needs to have the same application registered using TESTAPP_ENDPOINT, or otherwise nothing will make it up to the application. This is accomoplished
    by registering the endpoint interface description using afRegister() as shown in the init section of each of our sample applications.

    So, in order to send data to each router, you have to figure out what the short address of each router is. If you have 6 or less routers, you could figure out the short address by walking through the AssociatedDevList array.

    This discovery could also be done via service discovery using Match descriptor request or through other zigbee function calls such as simple descriptor request to find out device capablilites, that is up to the application developer.

    Broadcast messages don't require any binding or discovery of device capabilities. As you mentioned, you would set the addrMode to afAddrBroadcast (this makes sure that the correct bit in the frame control field is set).
    You can specify the same endpoint or a different endpoint if you would like to logically separate your own broadcast endpoint. You can also use the designated broadcast endpoint AF_BROADCAST_ENDPOINT. The shortAddr needs to be 0xFFFF
    or 0xFFFC (to all routers) or 0xFFFD (to all devices that have RxOnWhenIdle = TRUE - could be end devices with this flag set).

    Keep in mind that the number of broadcast messages you can send in one second is limited by the setting of _NIB.BroadcastDeliveryTime (default is 3 seconds I believe) and the MAX_BCAST setting. This means that a single device can send 9 broadcast messages within a window of 3 seconds, not more. This is to allow the broadcast messages to "settle" in the network, since each router will also repeat this message and there will be a long ping-pong effect (the effect increases if you have more routers in the system). That is why broadcast messages which are not radius limited are frowned upon. The radius can be limited to 1 if all routers are within radio range by setting the radius option in the AF_DataRequest function call to 1.

  • Hi Z,

    Thank you for responding to my question. I actually had figured out how to send broadcast messages before I got your post, by looking at the Z-Stack Developer's Guide. What I did not know, was how to send unicast messages from the Routers to the Coordinator. I tried what you described with a Coordinator sending broadcast messages, and 3 Routers sending unicast messages to the Coordinator, and it worked. I did not have to bind the Routers to the Coordinator, either.

    Now I would like to ask you, let's say I have a ZigBee network formed, with as many as 40 Routers and a Coordinator, and there are multiple hops required to communicate across the network. Will this method of broadcast messaging without binding from the Coordinator, and unicast messaging without binding from the Routers still work? If I want to communicate by having the Coordinator send a broadcast message to all the Routers, and then have every Router reply by sending a unicast message back, is there a limit as to required time separation between messages? If I need to, I could code each Router to have a different delay in replying to the broadcast message from the Coordinator. I appreciate your help.

     

  • Hi Z,

    I am making good progress with this, and I have some questions with programming my target hardware. I am now using the Z-Stack 1.4.3-1.2.1 with IAR v7.30b. I designed my hardware with a header which will be connected to P14 on a SmartRF04EB for programming per CC2430DK Development Kit User Manual, section 9.2. Looking at the Flash Programmer User Manual, Rev 1.4, section 5.2.2, it says "To produce a hex file for banked code, please see the manual named "Chipcon IAR User Manual" available from www.chipcon.com." So I am not sure if I can program the flash from the IAR Workbench per this section, since my code uses banked code, or whether I need to use the Chipcon Flash Programmer.

    In the IAR IDE User Manual, Rev 1.2, section 3.2.2 it says:

     "To use banked code model the following files have to be included in the project, they will

    overwrite the files that are included by default in the IAR library.

     

     

    Chipcon_cstartup.s51

    Chipcon_banked_code_support.s51"

    Do I have to copy these files from Z-Stack and put them into an IAR directory? In the IAR directories, I only find a file named cstartup.s51, not Chipcon_cstartup.s51. I find both in the Z-Stack directories.

     

    In section 5 it says:

    "Lnk51ew_cc2430b.xcl is for CC2430-F128 and banked code model"

    This file is only in an IAR directory, not the Z-Stack (which has f8w2430.xcl). Do I have to set the linker command file to Lnk51ew_cc2430b.xcl in the IAR Workbench?

    Thank you for any help you can give me on this. By the way, I have purchased the IAR permanent license and 40 CC2430 parts.

     

  • Where can i get the "TI ZigBee Workshop Student Guide"??

    thanks

  • Andie,

    We are working on ways of making this material publicly available.  Please stay tuned.

    Brian

  • Hello,

    I'm using the CC2430 db and I would like to program the coordinator to send message to all device in the network every 4hours

    The main idea that i have is to program a timer in the OSAL_Timer in the Generic Application by IAR,  but the problem that I have is

    1)where i enter my program exactly in the program defined in the OSAL_Timer.

    2)how to program a timer with the ZigBee stack.,if you can help me with some document

    Br

    Oussama

  • Hello,

    I'm using the CC2430 db and I would like to program the coordinator to send message to all device in the network every 4hours

    The main idea that i have is to program a timer in the OSAL_Timer in the Generic Application by IAR,  but the problem that I have is

    1)where i enter my program exactly in the code defined in the OSAL_Timer.

    2)how to program a timer with the ZigBee stack.,if you can help me with some document

    Br

    Oussama

  • can you help me  to solve these two problem

     

  • Hello,

    I'm using the CC2430 db and I would like to program the coordinator to send message to all device in the network every 4hours

    The main idea that i have is to program a timer in the OSAL_Timer in the Generic Application by IAR,  but the problem that I have is

    1)where i enter my program exactly in the code defined in the OSAL_Timer.

    2)how to program a timer with the ZigBee stack.,if you can help me with some document

    can you help me

    Br

    Oussama

  • How exactly did you perform the automatic binding from Router to Coordinator? Did you code a few lines or just use NV_RESTORE and do it manually one time to allow automatic binding at startup? Thanks for any info there.

    wazilian