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.

CC2530: How to change the channel of zigbee commucation dynamically?

Part Number: CC2530
Other Parts Discussed in Thread: TIMAC

Tool/software:

#define MSA_MAC_CHANNEL    =      MAC_CHAN_11;  // in msa.h TIMAC

is it ok the below modified source?

extern uint8 MSA_MAC_CHANNEL ;

MSA_MAC_CHANNEL =20; // in msa.c

if channel is chaged, how can check the frequency?

  • Hi Edan,

    Are you still evaluating the TIMAC v1.5.2 SDK solution?  Changing the MSA_MAC_CHANNEL in msa.c to 20 (or MAC_CHAN_20) correlates to a frequency of 2.450 GHz.  You could verify this with a spectrum analyzer, packet sniffer tool, or possibly Smart RF Studio 7 would be able to detect packets.  If you use the same channel for both the PAN Coordinator (Normal-FFD) and End Device (Normal-RFD) then you should observe them commissioning and communicating as compared to if they used different channels.

    Regards,
    Ryan

  • Yes I still use TIMAC v1.5.2 SDK.
    I need to change the channel for FCC certification.

    The coordinator have to make the frequency without EndDevice according to FCC.
    But no detect coordinator frequency without EndDevice on spectrum analyzer.
    It can be detected frequency with EndDevice.

  • The MAC Sample Application Coordinator does change set the channel dynamically as a static channel is selected for End Devices to find and join.  Network settings such as the channel are stored in non-volatile memory to be recovered after device resets and there is no frequency hopping mechanism for 2.4 GHz IEEE solutions.  The Coordinator has no reason to send radio packets without connected End Devices.  Unless you would like to consider using the Pan Coordinator in beacon mode?  See the MAC Sample Application Software Design for this and other details concerning application capabilities.

    Most FCC certifications I've been involved with previously allow other firmware to be evaluated so long as the same IEEE PHY radio is used.  Thus you could consider these other options:

    Regards,
    Ryan

  • if use Basic RF Software Examples , The coordinator can make the signal without EndDevice?

  • The Basic RF Software Examples do not consider network settings or stored information about connected devices, thus transmissions will be sent unimpeded.

    Regards,
    Ryan

  • In summary,
    Modify the basic RF software example to dynamically change channels. Then the coordinator can transmit signals without a device.
    You can check it in smartRFstudio.
    Is this what you mean?

    // lightSwitch.c in  the basic RF software example
    #define RF_CHANNEL 25 // 2.4 GHz RF channel

    The value of 2400 MHz is 25.

    if I want to set to 2435 MHz, what is the value?

  • You would focus on the basicRfConfig.channel to which RF_CHANNEL is assigned.  Below are the IEEE 2.4 GHz channel assignments:

      11 - 2405 MHz
      12 - 2410 MHz
      13 - 2415 MHz
      14 - 2420 MHz
      15 - 2425 MHz
      16 - 2430 MHz
      17 - 2435 MHz
      18 - 2440 MHz
      19 - 2445 MHz
      20 - 2450 MHz
      21 - 2455 MHz
      22 - 2460 MHz
      23 - 2465 MHz
      24 - 2470 MHz
      25 - 2475 MHz
      26 - 2480 MHz

    Thus channel 17 is 2435 MHz and channel 25 is 2475 MHz.

    Regards,
    Ryan

  • The appLight() of the basicRF Sample  didn't make signal without appSwitch() same as TIMAC .

    I have checked no signal by smartRFstudio.

    See the source code of appLight().

    There is no source for basicRfSendPacket(), which exists in appSwitch().

    static void appLight()
    {
        halLcdWriteLine(HAL_LCD_LINE_1, "Light");
        halLcdWriteLine(HAL_LCD_LINE_2, "Ready");
    #ifdef ASSY_EXP4618_CC2420
        halLcdClearLine(1);
        halLcdWriteSymbol(HAL_LCD_SYMBOL_RX, 1);
    #endif
    
        // Initialize BasicRF
        basicRfConfig.myAddr = LIGHT_ADDR;
        if(basicRfInit(&basicRfConfig)==FAILED) {
          HAL_ASSERT(FALSE);
        }
        basicRfReceiveOn();
    
        // Main loop
        while (TRUE) {
            while(!basicRfPacketIsReady());
    
            if(basicRfReceive(pRxData, APP_PAYLOAD_LENGTH, NULL)>0) {
                if(pRxData[0] == LIGHT_TOGGLE_CMD) {
                    halLedToggle(1);
                }
            }
        }
    }

  • I don't fully understand the issue you're experiencing.  The appSwitch is designed to send packets to appLight, not the other way around.  Modifications will be necessary to generate the correct solution in accordance with your needs.  The source of basicRfSendPacket is contained in basic_rf.c

    Regards,
    Ryan

  • Thanks for your answer.
    I added the source of basicRfSendPacket to while().
    I confirmed that the signal comes out when using only the router without the device.

    static void appRouter()
    {
        initUART();
        // Initialize BasicRF
        basicRfConfig.myAddr = ROUTER_ADDR;
        if(basicRfInit(&basicRfConfig)==FAILED) {
          HAL_ASSERT(FALSE);
        }
        basicRfReceiveOn();
        // Main loop
        while (TRUE) {
            pTxData[0] = '0';
            pTxData[1] = '2';
            pTxData[2] = ':';
            pTxData[3] = 0x34;
            pTxData[4] = 0x35;
            pTxData[5] = 0x36;
            pTxData[6] = 0x37;
            pTxData[7] = 0x38;
            pTxData[8] = 0x39;
            pTxData[9] = '\n';      
        
    
    
            //while(!basicRfPacketIsReady());
            while(TRUE){             
              //basicRfReceiveOff();
              basicRfSendPacket(DEVICE_ADDR, pTxData, APP_PAYLOAD_LENGTH);
              //basicRfReceiveOn();
              if(basicRfPacketIsReady())
                break;
            }
            if(basicRfReceive(pRxData, ROUTER_DATA_LENGTH, NULL)>0) {
    			for(int i=0;i<ROUTER_DATA_LENGTH;i++)
    				send_uart(pRxData[i]);
            }
    
        }
    }