Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

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.

how to program for cc2530

Other Parts Discussed in Thread: Z-STACK, CC2530, CC2530EM, CC2650

hi folks,

        I am newbie to cc2530DK. I just want to start with this kit. Earlier i Used 8051 microcontroller for data transmission using Zigbee. I Used to write software for 8051 using keil compiler, After compiling successfully, the hex file i used to dump in to 8051 microcontroller through flash. I used to connect zigbee in tx and rx pin of 8051.

                   Now i want to know cc2530DK which controller is using???how can i write a program for my application. I know only, instead of keil, i need to use IAR. Then how can i flash the hex file. my requirement is, one node should act as coordinator and other node should monitor a temperature and send to node 1 through Zigbee. Node 1 should receive the node 2 value and display the temp in the lcd. How can i proceed.

I will be thankful if  somebody help me out

  • Install ZStack and there are lots of documents and example code inside.

  • First of all i don't know what is zstack. Earlier i just interface zigbee with microcontroller and communicate through UART programming(diffrent program for 8051 and PIC) .

              For example i am having a 2 nodes, node1 and node2.  Node 2 need to sent some data to node 1. node 1 will receive data and display in the lcd(which is nothing but a broadcasting). What i have done is, i done program for node 2 microcontroller for sending info by calling uart transfer function. It will send data to node 1. In node 1 microntroller, i have done prog that if he receives any values through zigbee via UART,he has to display in the lcd. this for two section/nodes.

                           If i want to communicate with three Zigbee, what should i do?. I used a I2c protocol, in that i have send a id address and payload data. Then that particular address device will accept the data. Like wise, the Zigbee has such protocol?? whether this type of implemetation is called Z-stack??.

                              If i want to communicate a with three zigbee, If i want to send a data to one particular zigbee then how can i send?? Is there any MAC address to notify??

                              If i am using CC2530. It has internal controller right?? IF it is having means, no need to use 8051 core right????.

                               Where i will get a Zstack???i have seen some exe files in ti website of zstack?? how can i use that?? Is this some like this, zstack is a library, which we need port on CC2530 and we need to use some API for sending and receving the data????

                         Can some body reply to these question???? sorry for so basics question. I will be thankfull to you if help me out.

  • ZStack means Zigbee stack and here specify for TI's implementation of Zigbee Stack. From your post, I think zigbee can serve your purpose without problem. My suggestion is still that you download and install ZStack swrc126.zip from http://www.ti.com/tool/z-stack. After install ZStack, there are lots of documents and examples inside. Read and try them first. 

  • this zip contains exe file... but how should i use that to communicate between the Zigbee??? Where is Zstack in that page??? how can i install that??

  • May I ask what Zigbee HW you use? CC2530DK or ZNP mini kit?

  • I want to use CC2530. I installed z-tool. How can i write a code using z-tool??then how to flash in the cc2530 controller??? or  else i need use IAR. i am pretty confuse.. can u clear me. What should i use and why?? what is the difference b/w IAR and Z-tool???  

  • Can some one reply to my prev post.. I have struck in the starting stage itself. 

                              

    I have downloaded and installed the IAR IDE in my system. Before installing, they have mentioned that, it is trial version for 30 days. But after the opening the IAR it is asking for license. asking to enter the licence number. How can i proceed.

                        And one more question is what are api's in IAR to call zstack to communicate with zigbee. IF i want send select coordinator, what is the API. IF i want to send a data, what is the API and for receive a data what is the API. IS there any sample program for sending and receving the data through zigbee 

  • Now i installed IAR, no problem with IAR . Reply me other than this question. I will be thankful, if some one help me out. which will build my career.

  • If you install ZStack, the is a GenericApp example. I would suggest you have a look on it. Try to use it to study TI's zigbee stack.

  • I have gone through the generic App. And i have seen one pdf from ti.the API's used in Zstack for initialization, transmitting and receiving data. None of the API's are used in this App.

                         Can u tell if i want to use those API's how can i??? is that is stored in the standard Path of IAR which is header???  And i am confused which API i want to use. Because,different PDF is pointing to different API. I hope you understand my problem. 

  • And some header's are defined as that header's in current directory, but those header's are not there, for example 

                                       

    #include "OSAL.h"
    #include "AF.h"
    #include "ZDApp.h"
    #include "ZDObject.h"
    #include "ZDProfile.h"

    where can i find those???

  • i can able to find those files..it is in components. Now tell me, how this is compiling without main. I have gone through the code, they have mentioned that. zmain.c . without that how it is compiling????

  • If you don't use main, the example doesn't work. Please specify your intention. I have no idea how to help.

  • @Yikai, thanks for helping so far. please i am in urgent to do my project as i told in my 1st post. I want to to Some basic things...

             I have seen the API for sending data AF_Datasend(......);, this called function where it will be??? in IAR or what... I will be thankful if you help me

  • in Generic App, There is no main...That only make me strange...

  • The main function is inside ZMain.c which  located at \Projects\zstack\ZMain\TI2530DB.

  • When you want to send message from one node to another, you can use API AF_DataRequest.

  • First of all thanks for your kind answer YiKai Chen. Ya i know that i used to send the message. I have gone through the all pdf, which i got after installing z-stack. It is very confusing and difficult to understand. I am getting some points while reading one PDF and i am getting confuse when i start to read other. 

                       The timers are using in both hal and osal. If i want to use timer means, which api should i use??

    Now let me the question very clear.

      I am having 3 CC2530EM, i want to communicate these three, which one should act as coordinator, and other should act as router and enddevice.

           Q1. how we should set those device types??

    The answer which i got in one PDF, that we need set that in IAR IDE and while in other PDF, i have seen one macro for setting the device type. which is correct?

         Q2. After setting the device types, how should initialize the devices and what is use of initialization?

         Q3. how to connect all devices in a network??

         Q4. How to set timer? what is difference between osal_timer and hal_timer??

         Q5. After that i need to send a message  to coordinator from one of the router among two. what are step i need to follow? means how can i get device id of cordinator,inorder to send to it.??? what is task_id??? what is event_id?? how can i get those??

        Q6. If i am using the api, what header i need to add in IAR. why this IAR IDE only comparing with other like keil, and compiler like gcc and sdcc.

    I request to help me with answering those question. 

  • First of all thanks for your kind answer YiKai Chen. Ya i know that i used to send the message. I have gone through the all pdf, which i got after installing z-stack. It is very confusing and difficult to understand. I am getting some points while reading one PDF and i am getting confuse when i start to read other. 

                       The timers are using in both hal and osal. If i want to use timer means, which api should i use??

    Now let me the question very clear.

      I am having 3 CC2530EM, i want to communicate these three, which one should act as coordinator, and other should act as router and enddevice.

           Q1. how we should set those device types??

    The answer which i got in one PDF, that we need set that in IAR IDE and while in other PDF, i have seen one macro for setting the device type. which is correct?

         Q2. After setting the device types, how should initialize the devices and what is use of initialization?

         Q3. how to connect all devices in a network??

         Q4. How to set timer? what is difference between osal_timer and hal_timer??

         Q5. After that i need to send a message  to coordinator from one of the router among two. what are step i need to follow? means how can i get device id of coordinator ,in order to send to it.??? what is task_id??? what is event_id?? how can i get those??

        Q6. If i am using the api, what header i need to add in IAR. why this IAR IDE only comparing with other like keil, and compiler like gcc and sdcc.

    I request to help me with answering those question. 

    i forgot some more question

    Q7. For acknowledge to coordinator after receiving   the message by a end device, which call back api is used?

    Q8. CC2530 has internal microcontroller which supports ADC. how to write a App for ADC to get a sensor value and convert it to digital. where sensor is connected to gpio of that controller?

        I think These question is will be helpful to starters of cc2530. I request you to answer these. thanks in Advanced


  • Allen lusy posted RE: how to program for cc2530 in Low Power RF ZigBee® Software & IEEE 802.15.4 Forum.

    First of all thanks for your kind answer YiKai Chen. Ya i know that i used to send the message. I have gone through the all pdf, which i got after installing z-stack. It is very confusing and difficult to understand. I am getting some points while reading one PDF and i am getting confuse when i start to read other. 

                       The timers are using in both hal and osal. If i want to use timer means, which api should i use??

    Now let me the question very clear.

      I am having 3 CC2530EM, i want to communicate these three, which one should act as coordinator, and other should act as router and enddevice.

           Q1. how we should set those device types??

    The answer which i got in one PDF, that we need set that in IAR IDE and while in other PDF, i have seen one macro for setting the device type. which is correct?

         Q2. After setting the device types, how should initialize the devices and what is use of initialization?

         Q3. how to connect all devices in a network??

         Q4. How to set timer? what is difference between osal_timer and hal_timer??

         Q5. After that i need to send a message  to coordinator from one of the router among two. what are step i need to follow? means how can i get device id of coordinator ,in order to send to it.??? what is task_id??? what is event_id?? how can i get those??

        Q6. If i am using the api, what header i need to add in IAR. why this IAR IDE only comparing with other like keil, and compiler like gcc and sdcc.

    I request to help me with answering those question. 

    i forgot some more question

    Q7. For acknowledge to coordinator after receiving   the message by a end device, which call back api is used?

    Q8. CC2530 has internal microcontroller which supports ADC. how to write a App for ADC to get a sensor value and convert it to digital. where sensor is connected to gpio of that controller?

        I think These question is will be helpful to starters of cc2530. I request you to answer these. thanks in Advanced

  • You can find answers for most of your questions on Z-Stack Sample Applications.pdf which is located at \ZStack-CC2530-2.5.1a\Documents. I suggest that you read it and have some hands-on first.

  • hello every one, 

    i have bought a zigbee cc2530 module interfaced with Rs232 . Actually i would like to use this module for making home automation project. At one end i would like to send the data from PC ->serial port->cc2530module and at the other end the cc2530 module is attached to a 8051 microcontroller to on/off the relays. I am starter to these RF modules . SO please can anyone help me in establishing the link between the two zigbee cc2530 modules so that they communicate. it was already a month i started this. How can i proceed with this..

    i will be thankful if anayone could give me a solution

  • Download Z-Stack Home 1.2.0 and install it. There are lots of document in the doc folder after installation. I would recommend you start test on SampleSwitch and SampleLight project. By the way, this thread is not related to your beginner question and I would suggest you to create a new post for your question.

  • plz any body help for the source code of switch the light from cc2530 board with zigbee

  • Can you elaborate your problem?
  • actually i want to work on cc2530
    and im not having any idea about how to program cc2530
    previously i worked on keil compiler for 8051
    and want to know how to interface PIR sensor with cc2530
    what are the requirements for that (modules,componets) ?

    thnk you so much fr instant reply
  • According to my experiences, PIR sensor is not suitable to connect to CC2530 directly. I suggest you to connect PIR sensor to a light weight MCU such as MSP430 to do ADC calculation and then use GPIO connecting to CC2530 to notify if there is motion detected.
  • but the PIR sensor gives digital output only (if "detected " '1' and "not detected " '0'),
    i think so we dnt require ADC calculations .
    bcz for arduino uno i have connected PIR directly to GPIO pin

    one more ques
    how to configure GPIO pin of cc2530
  • If you use examples in Z-Stack, you can refer to hal_key.c which shows you how to configure GPI as interrupt source.

  • Ok have install Z-stack , teo app are installed on my pc those are OTA server and serialbbot tool
    what are those applications
  • Which Z-Stack version do you install?
  • z-stack 3.0.0
  • You can find examples under C:\Texas Instruments\Z-Stack 3.0.0\Projects\zstack\HomeAutomation
  • thank you very much for your help
    this will defiantly help me lot.


    how to dump code into the cc2530 ?
  • which programmer should i use to fuse the code into cc2530 ??
  • You can start from SampleLight and SampleSwitch.
  • yes im trying to but my IAR is older one 7.51 trying to update but its not updating
    can i use keil micro vision ?
  • No, you have to use IAR.
  • error im getting is code is done by higher version so cant open
    if u r having IAR 9.30 will u plz share mi the exe file or zip file
  • What do you mean sharing exes or zip file?
  • i mean IAR workbench software
  • You can download trial version from IAR web site.
  • ok thank u i will try
  • i have installed IAR workbench for 8051 and now it is not giving any error

    how can i fuse or dump the "sample light" app from z-stack into the cc2530

  • You can use "Download and Debug" in IAR to dump SampleLight application into CC2530DK.
  • yes
    but which hardware i required to dump the code
    sorry for very basic ques ?
  • Don't you have CC2530DK?
  • not now
    but i have to purchase so which should i buy .
  • So you don't have any CC2530 HW? If so, you can buy CC2530DK.
  • ok thank u so much