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.

EZ430-RF2480 Simplest Zigbee example code.



Hi. I'm trying to create a ZigBee system which would do the folowing -

by the interrupt at a node some bytes should be sent to the sink
connected to PC, PC shows the bytes in Hyper Terminal.

For the base I took ZASA.
Is that right that by setting halEventFlags |= 1 in the Interrupt routine I can trigger the ZigBee
data transmission to the sink?

I just want to block the periodic reports and trigger the report transmission by the interrupt
on port1 or port 2.

Could anyone help me how to do it in the optimal way?

Or maybe someone has detailed documentation on ZASA? The one I downloaded from TI
doesnt contain enough information on how exactly the system works, which parameters and
flags are used.

And what I would really be happy to get is a self contained walkthrough for creation of
ZigBee communication - just a simple data transmit/receive.

So if anyone could share some information and help me in this  - I would greatly appreciate
any assistance.

 

Thank you very much.

 

  • Actually, the sample code for the EZ430-RF2480 does not use interrupts to handle radio events, but it constantly polls to see if any event flags are set by the microcontroller routines or the radio events.  If you set halEventFlags |= HAL_EVT_TIMER_APP (which is 0x0002), the end-device will initiate a ZB_SEND_DATA_REQUEST, provided that the network has been started and the device has formed a binding with the coordinator.

    The periodic reporting of data occurs because the HAL_EVT_TIMER_APP is set by a timer.  You would have to disable this timer to stop the periodic reports, but you have to be sure that you disable it after the network is  started and bound to the coordinator.  A real quick-and-dirty way of handling what you want to do though would be to remove the section from the appExec routine for case appRunning, so that once the end-device joins the network and forms a binding the HAL_EVT_TIMER_APP flag will not trigger any more action.  Then add an "else if (halEventFlags & HAL_EVT_SPB) { *clear HAL_EVT_SPB and call a new routine} in the appExecHal routine  . .. Then in the new routine add the section of code from the appExec that you remove for case appRunning.

     

     

  • Thank you very much for the reply, RFCE. I greatly appreciate your help.

    What I did so far is set the interrupt on P2.2 and in the interrupt routine I set
    halEventFlags |= HAL_EVT_TIMER_APP

    In the TimerA Interrupt routine I just check that halEventFlags is never set for HAL_EVT_TIMER_APP

    Next step I'm planning to try the way you offered, because it is more natural. Thank you very much for the great idea. 

     

    I have a question which is very important for me. Maybe you have a documentation on the sequence of ZigBee connection procedure.
    Just step by step how to connect to the known coordinator.

    For my project I need to connect to the coordinator, receive command from it, send the response and disconnect.
    Maybe you could recommend an example or some documentation to read?

    Thank you very much.

     

     

     

     

  • I would recommend reading the CC2480 Developer's Guide, which can be found on the CC2480 product page.  Also, the CC2480 Interface Specification provides the necessary frame formats of the commands as well as documentation of the serial interface.

    In short, if a coordinator is established, the simple API library can be used to establish communications in only a few steps.  The first is to configure the CC2480 configuration parameters using multiple calls to the ZB_WRITE_CONFIGURATION command.  This sets up such things as the device type, RF channel, PAN ID, and poll rates.  Once configured, you will need to register the application using the ZB_APP_REGISTER_REQUEST or the AF_REGISTER command.  This MUST be done every time the CC2480 resets, as the registeration is not NV.  Look at the srceEP[] in the SampleApp for the contents of the registration. 

    Once the end-device application is registered, the end-device can be join an existing network using the ZB_START_REQUEST.  When you receive a AREQ command of ZB_START_CONFIRM with status=success, the end-device has successfully joined the network.  To send data to the network coordinator, you have two options.  1) You can bind endpoints with the coordinator as is implemented in the sample source code.  This links the two endpoints and creates a binding table so that the devices can communicate with each other without you having to  know or specify the destination address.  You bind with the ZB_BIND_REQUEST, which signals success through the ZB_BIND_CONFIRM.   After successful binding, you can send data to the network coordinator using the ZB_SEND_DATA_REQUEST or AF_DATA_REQUEST commands.  2) If you do not need or want endpoint binding (if you always know the addresses of the devices being addressed), you can simply send data using the AF_DATA_REQUEST or ZB_SEND_DATA_REQUEST commands.  For the EZ430-RF2480, the network coordinator is assigned a short-address of 0x0000.

  • Thank you very very much RFCE.

    I couldn't even imagine a better answer. You helped me a lot!

    I'm trying to implement it right now.

    Thanks!!!