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.

cc2531 ZLight2 LED control

Other Parts Discussed in Thread: CC2531, Z-STACK

Hi Guys,

I am trying to use the ZLight2 Led board in one of my projects to demonstrate a successful Zigbee porting on CMU's Firefly platform. We have used ZBOSS stack as a reference and implemented the zigbee functionality on Firefly and plan to use the same ZBOSS stack on the TI's cc2531 ZLight2 board. Now my goal is to make both the boards communicate with each other and control LED's on cc2531 configured as End Device (ED). Now I am to sniff zigbee packets from the ZLight2 board and it sends out beacon requests properly. However, when I try to control the LED's I see only fixed RED light glowing. I have taken the sample light from zstack as example and ported the HAL related files to ZBOSS. I am directly using HAL_TURN_OFF_LED1() or HAL_TURN_ON_LED1() functions in my application. Am i missing something here? It looks like I am not able to control the led's properly.

Best Regards,

Abhijit

  • Hi,

    For your information, the sample color engine contained in the Z-stack lighting SDK uses API defined in hw_light_ctrl.h, as mentioned in section 7.6 of Z-stack Lighting Developer's guide.pdf in C:\Texas Instruments\Z-Stack Lighting 1.0.2\Documents.

    Please note this forum is about TI ZigBee product solutions. You are using a combination of HW from TI and SW from a third party which is a patchwork of solution which we don't recommend.

    As we provide a total solution, we encourage customers to use TI reference SW with TI reference HW.

    We won't be able to support queries on SW solutions which are not based on TI reference SW.

    Thanks,

    TheDarkSide

  • Hi TheDarkSide,

    I appreciate your response to my question. I will try to make this specific to TI development kit. I will modify my question a bit. Suppose I do have to write a  program that directly modifies the registers that control the 4 lighting LED's on the ZLight2 board, which of them should I modify? I am currently looking at hal_board_cfg.h file  for cc2531 and I see some functions that are used to set ON and OFF leds. However, I do not see such changes when I run my program. Can you provide me the procedure to control the Led's from HAL.

    Best Regards,

    Abhijit

  • You can refer to the ZLight2 schematic and revise the code accordingly.

    P0_3: RED LED

    P0_4: BLUE LED

    P0_5: GREEN LED

    P0_6: WHITE LED

  • Hi Yikai,

    Thanks a lot for your reply. I am able to control LED's on the sniffer if I use the same program I wrote. But it still does not work for the Zlight2 board. Is there any other hal_board_cfg.h that for the ZLight2 board? I see that the config file has only two Led's so I figured out that it must be for the USB dongle. Anyway thanks  a lot though.

    Best Regards,

    Abhijit Lele

  • Would you tell me which z light example do you use in your test?

  • Hi Yikai,

    I am using the SampleApp example from the Z-stack lighting 1.0.2 code base. As explained in my first post I am trying to run ZBOSS end device application on ZLight2 board where I will be setting an LED based on the packets I receive. This is just an initial step in confirming whether our ZBOSS code works the way it is supposed to. To make this happen I have included HAL related files into the ZBOSS platform specific code and included it in my application. The application does compile and I can control LED's on the USB dongle but not on the ZLight2 Board. So effectively I am just using functions from hal_led.c and hal_drivers.c to make led's on/off based on the hal_board_cfg.h file.To make the picture more clear for you, we were trying to make the Firefly (nanork) platform communicate on Zigbee and for that we have ported ZBOSS stack on it. We are using TI's ZLight2 bulbs to test our porting. We are configuring one of our Firefly nodes as Coordinator and the ZLight2 as ZBOSS's  End Device configuration with HAL files from Zstack.

    I am sorry if I made this more complicated :(

    Best Regards,

    Abhijit

  • I don't have experience on ZBOSS platform but I think you can't use functions in hal_led.c directly in Z-Stack. I guess there should be similar API in ZBOSS platform and I suggest you revise it to server your purpose.

  • Hi,

    I am able to control the two LED's on cc2531 usb dongle with my approach. However, the ZLight2 board does not show any changes. The Red light glows even after the flashing is complete.

    Abhijit

  • Hi Yikai,

    I am now able to control the LED's on Zlight2 board as well through a ZBOSS application program. I just had to modify the ha_board_cfg.h file in the HAL where I had to write a new set of of macros which would control P0.3 to P0.6 pins. I then moved the related header files into our code and it works absolutely fine. Thanks a lot for your help!

    Best Regards,

    Abhijit Lele