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.

Reset CC2530 from all Coordinators

Other Parts Discussed in Thread: CC2530

Hello,

How would I program my CC530 board to be reset from all coordinators. Right I have a CC2530 connected to 1 coordinator. I wanted to connect the CC2530 to the 2nd coordinator, so I unpowered the 1st coordinator without properly disconnecting the CC2530. I powered the 2nd coordinator and tried to connect my CC2530 to the 2nd coordinator. However the CC2530 doesn't connect to the 2nd coordinator and still has its mind set on the 1st coordinator. How would I reset the CC2530 so that it would forget about all of its connections with previous coordinators? I am currently using SampleLight in IAR 8051. I would very much appreciate any helpful replies.

  • As I know, P0.1 is only used in hal_key.c as SW6 of SampleLight example. Can you elaborate what your problem is now?
  • The problem is still the same. When I presss SW6, it does SW1 and SW6 stuff. When I press SW1, it does SW1 an SW6 stuff. So I wanted to delete everything about P0.1 so I can just use the code from Code.txt.
  • Apparently in zclSampleLight_event_loop(), the code below proves that both switches are on because when I press either button it does nothing. How do I make it so the code reads that the button is off or on? I replaced the zclSampleLight_HandleKeys with this. When I get rid of !HAL_KEY_SW_2, the problem I had still occurs.

    case KEY_CHANGE:

    if( HAL_KEY_SW_1 && !HAL_KEY_SW_2){
    extern void ZDApp_ResetTimerStart( uint16 delay );
    zgWriteStartupOptions(ZG_STARTUP_SET, (ZCD_STARTOPT_DEFAULT_NETWORK_STATE | ZCD_STARTOPT_DEFAULT_CONFIG_STATE) );
    ZDApp_ResetTimerStart(2000);
    }
    else if( HAL_KEY_SW_1 && !HAL_KEY_SW_6){
    giLightScreenMode = LIGHT_MAINMODE;

    // toggle local light immediately
    zclSampleLight_OnOff = zclSampleLight_OnOff ? LIGHT_OFF : LIGHT_ON;
    #ifdef ZCL_LEVEL_CTRL
    zclSampleLight_LevelCurrentLevel = zclSampleLight_OnOff ? zclSampleLight_LevelOnLevel : ATTR_LEVEL_MIN_LEVEL;
    #endif
    }

    break;
  • You can not use if( HAL_KEY_SW_1 && !HAL_KEY_SW_2) statement which would always true.
  • My hardware configuration must've been a lot different than the CC2530DK, but now after enormous amount of testing changes in the code, I was able to get both switches working correctly and doing exactly what they're supposed to do. Thank you YK Chen!
  • You are welcome and it's good to know it works now.