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 use button to toggle change Channel?

Other Parts Discussed in Thread: CC2530

Usually we edit f8wConfig.cfg to set the node channel and choose between 11-26 available channel.

Default is 11. Now I want to use a button to toggle selecting channel. I use samplelight as my reference and CC2530.

Any tips on how to start? Thanks.

  • It's from previous e2e thread, "not" my code.

    For your reference.

    you can change the channel. Use the code below.

    #include "OSAL_Nv.h

     

    uint8 ch = 12; //channel number

    uint32 tmp32 ;

      // Switch channel                                    

    _NIB.nwkLogicalChannel = ch;                                     

    MAC_MlmeSetReq( MAC_LOGICAL_CHANNEL, &ch); 

        // Our Channel has been changed -- notify to save info into NV                                    

    ZDApp_NwkStateUpdateCB();                                    

     // Reset the total transmit count and the transmit failure counters                                    

    _NIB.nwkTotalTransmissions = 0;                                                                          

     tmp32 = ((uint32)1 << ch); //update the channel mask                                                                           

     (void)osal_nv_write(ZCD_NV_CHANLIST, 0, 4, &tmp32);

  • You can refer to the discussion at http://e2e.ti.com/support/wireless_connectivity/f/158/p/249209/876517.aspx#876517