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.

Z-Stack Samples Without TI's Development Kit

Other Parts Discussed in Thread: CC2530, Z-STACK

Hello All,,,

I have CC2530 Module from http://es-tech.taobao.com (image attached) with simple schematic, that module only have 3 LEDs on P1.4 , P1.5 , P1.6 ; 3 Tictac Switchs on P1.1 , P1.2 , P1.3 ; and Reset Button. But the TI's Development Kit are have a complex schematic.

My question is, can i use Z-Stack samples for use in my module?

How can i use Z-Stack in my module?

Thank You.

  • Hi,

        Yes you can use ZStack, but you will need to modify the HAL Layer to support this HW. You can remap the LED/Switch GPIO's in Components\hal\target\CC2530EB\hal_board_cfg.h:

    /* 1 - Green */
    #define LED1_BV BV(0)
    #define LED1_SBIT P1_0
    #define LED1_DDR P1DIR
    #define LED1_POLARITY ACTIVE_HIGH

    ....

    /* S1 */
    #define PUSH1_BV BV(1)
    #define PUSH1_SBIT P0_1

    #if defined (HAL_BOARD_CC2530EB_REV17)
    #define PUSH1_POLARITY ACTIVE_HIGH
    #elif defined (HAL_BOARD_CC2530EB_REV13)
    #define PUSH1_POLARITY ACTIVE_LOW
    #else
    #error Unknown Board Indentifier
    #endif

    /* Joystick Center Press */
    #define PUSH2_BV BV(0)
    #define PUSH2_SBIT P2_0
    #define PUSH2_POLARITY ACTIVE_HIGH

    Unfortunately you will only have access to 2 buttons without modifying the hal_key.c driver.

    You should also check Osc is fitted and set below accordingly:

    /* This flag should be defined if the SoC uses the 32MHz crystal
    * as the main clock source (instead of DCO).
    */
    #define HAL_CLOCK_CRYSTAL

    Then disable the unused drivers, such as:

    /* Set to TRUE enable LCD usage, FALSE disable it */
    #ifndef HAL_LCD
    #define HAL_LCD FALSE
    #endif

    Regards, TC.

  • Hi,

    Thank you for your explanation. But i still confused with the Source Code from Z-Stack, those are very complex .

    Can you tell me, how can i setting the CC2530 so that i can communicating with 2 Module?

    I can't found the function that can sending data to other module using Z-Stack sample.

    I hope you tell me Detail Quick Start Flowchart to setting CC2530 from begin and setting the CC2530 as Coordinator, Router and End Device.

    Thank You.

  • Hi TopCat,

    Can you reply my question as soon?

    I very need your help for my project.

    Thank You.

  • Hi,

        There should be a Documents folder in the ZStack installation directory. The document "Z-Stack User's Guide - CC2530DB.pdf" should tell you everything you need to get simple commands sent between 2 devices. The Demo configuration that you are instructed to use, uses jumpers on GPIO's to select which device is Coord, if you prefer you can select at program time by select CoordinatorEB, RouterEB or EndDeviceEB instead of DemoEB.

    More information about the message flow and other sample application can be found in "Z-Stack Sample Applications.pdf".

    Regards, TC.

  • OK thankyou a lot TC.

    I will read the document and trying.

    If i have a problem, i will contact you. :D

    Regards, FP.

  • Hi TC,

    I have a problem with my module that different with CC2530 Development Board (CC2350DB). In CC2530DB used ADC to read Switchs State, but in my module just used GPIO to read Switchs state. How can i change the Z-stack code that can read my switchs on P1_1 , P1_2 , P1_3?

    I already read Z-stack Sample Applications.pdf, and i found AF_DataRequest() Function to sending data, but one of the parameter is Destination Addr. How can i sending data to specified address? can you give me an example code to sending data?

    Because i still confused with the paper.

    Thank You.

  • You can refer to SW_6, which uses P0.1 as switch in hal_key.c, to make your own switchs on P1.1, P1.2, and P1.3 accordingly. For AF_DataRequest, you can refer to the code in the followings:

    dst.addrMode = afAddr16Bit;

    dst.shortAddr = 0xXXXX; //short address here

    dst.endPoint = ENDPOINT;

    AF_DataRequest( &dst, &epDesc,
                                 ZCL_CLUSTER_ID,
                                 (byte)pBuf_len, //len of message you want to send
                                 (byte *)pBuf_write, //Message that you want to send
                                 &TransID,
                                 AF_DISCV_ROUTE, AF_DEFAULT_RADIUS )

  • Hi Yikai Chen,

    Is your sample code above using IEEE standart packet and addr?

    How can i get addr from each device?

    What is the meaning og ENDPOINT?

    Thank You.

  • When a device joins network, ZC will receive a end node announcement and there will be IEEE and short address inside. Then, you can issue active end point request by ZDP_ActiveEPReq to get active end point of your end device. By the way, endpoint is like port in network environment.