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.

Problem in get working WOR functionality

Other Parts Discussed in Thread: SIMPLICITI, CC2500

[Problem:
I m using SimpliciTI stack with EZ430-RF2500 development kit. I have modified simple link-listen sample application. Instead of blinking LEDs I m issuing ping requests. I have written the code for wake on radio functionality as per application not - AN047. Following are the setting I am using for various registers MCSM0 0x18 MCSM2 0x01 WOREVT1 - 0x01 WOREVT0 - 0xF1 WORCTRL - 0x78 IOCFG2 - 0x06 Also have configured GPIO pin 2.7 of microcontroller to Rising eadge interrupt. Then I m issuing SWOR strobe to put radio in WOR mode. Note : Before putting radio in WOR mode I have linked it to another radio unit (Same as is done in Link-listen application) I m sending stream of packets from another device to wake-up the radio from WOR mode. With this I am getting the interrupt on the microcontroller from the CC2500 GDO2 pin. I am then issuing the idle strobe to come out of WOR mode. And then putting the radio in RXon mode so that it can respond to the further packets. But after this the Radio is showing no activity. It is not responding to the ping requests send to it any more. I also tried flushing the Rx buffer by calling RxIdle but it didn't work Please reply ASAP. ]

[Steps Needed to Recreate Problem:

#define SMARTRF_SETTING_FSCTRL1    0x07
#define SMARTRF_SETTING_FSCTRL0    0x00
#define SMARTRF_SETTING_FREQ2      0x5D
#define SMARTRF_SETTING_FREQ1      0x44
#define SMARTRF_SETTING_FREQ0      0xEC
#define SMARTRF_SETTING_MDMCFG4    0x2D
#define SMARTRF_SETTING_MDMCFG3    0x3B
#define SMARTRF_SETTING_MDMCFG2    0x73
#define SMARTRF_SETTING_MDMCFG1    0x23
#define SMARTRF_SETTING_MDMCFG0    0x3B
#define SMARTRF_SETTING_CHANNR     0x03
#define SMARTRF_SETTING_DEVIATN    0x01
#define SMARTRF_SETTING_FREND1     0xB6
#define SMARTRF_SETTING_FREND0     0x10
#define SMARTRF_SETTING_MCSM0      0x18
#define SMARTRF_SETTING_FOCCFG     0x1D
#define SMARTRF_SETTING_BSCFG      0x1C
#define SMARTRF_SETTING_AGCCTRL2   0xC7
#define SMARTRF_SETTING_AGCCTRL1   0x00
#define SMARTRF_SETTING_AGCCTRL0   0xB0
#define SMARTRF_SETTING_FSCAL3     0xEA
#define SMARTRF_SETTING_FSCAL2     0x0A
#define SMARTRF_SETTING_FSCAL1     0x00
#define SMARTRF_SETTING_FSCAL0     0x11
#define SMARTRF_SETTING_FSTEST     0x59
#define SMARTRF_SETTING_TEST2      0x88
#define SMARTRF_SETTING_TEST1      0x31
#define SMARTRF_SETTING_TEST0      0x0B
#define SMARTRF_SETTING_FIFOTHR    0x07
//#define SMARTRF_SETTING_IOCFG2     0x29 - Defined below
#define SMARTRF_SETTING_IOCFG0D    0x06
#define SMARTRF_SETTING_PKTCTRL1   0x04
#define SMARTRF_SETTING_PKTCTRL0   0x05
#define SMARTRF_SETTING_ADDR       0x00
#define SMARTRF_SETTING_PKTLEN     0xFF

//#ifdef CC2500_WOR_ENABLED
// RC_PD - RC osci power down: EVENT1 - 3: RC_CAL - Eanbled: WOR_RES 00
#define SMARTRF_SETTING_MCSM2      0x01 /*0x00*/
#define SMARTRF_SETTING_WOREVT1    0x01 /*0x28*/
#define SMARTRF_SETTING_WOREVT0    0xF1 /*0xA0*/
#define SMARTRF_SETTING_WORCTRL    0xF8 /*0xB8*/

#define SMARTRF_SETTING_IOCFG2     0x2E
//#endif CC2500_WOR_ENABLED

/* WOR functionality*/
#define WORACT_SETTING_WORCTRL	0x78 /*0x38*/
#define RCCALIB_SETTING_WORCTRL	0x70 /*0x30*/
#define WORACT_SETTING_IOCFG2   0x06
//#define ENABLE_INDPNDNT_RCCALIB


/*
 * Modified Bu Sameer S. Upasani to eanble WOR functionality
 */ 
#define MRFI_WOR_INT_PIN_IS_HIGH()                  MRFI_GDO2_PIN_IS_HIGH()
#define MRFI_ENABLE_WOR_PIN_INT()          		    MRFI_ENABLE_GDO2_INT()
#define MRFI_DISABLE_WOR_PIN_INT()              	MRFI_DISABLE_GDO2_INT()
#define MRFI_WOR_PIN_INT_IS_ENABLED()              	MRFI_GDO2_INT_IS_ENABLED()
#define MRFI_CLEAR_WOR_PIN_INT_FLAG()              	MRFI_CLEAR_GDO2_INT_FLAG()
#define MRFI_WOR_PIN_INT_FLAG_IS_SET()             	MRFI_GDO2_INT_FLAG_IS_SET()
#define MRFI_CONFIG_WOR_PIN_FALLING_EDGE_INT()     	MRFI_CONFIG_GDO2_FALLING_EDGE_INT()
#define MRFI_CONFIG_WOR_PIN_RISING_EDGE_INT()     	MRFI_CONFIG_GDO2_RISING_EDGE_INT()


void MRFI_Wor_Sleep(void)
{
  bspIState_t s;

  /* Configure GDO2 pin of Radio to generate interrupt for microcontroller to wakeup */
  mrfiSpiWriteReg(IOCFG2, WORACT_SETTING_IOCFG2);
  
  /* Enable interrupt on MCU Pin P2_7 for WOR interrupt*/ 
  MRFI_DISABLE_WOR_PIN_INT();
  MRFI_CONFIG_WOR_PIN_RISING_EDGE_INT();
  MRFI_ENABLE_WOR_PIN_INT();
  BSP_ENABLE_INTERRUPTS();
  
  /* Turn on the RC oscillator - Note: Already done in MRFI_Init*/
  //mrfiSpiWriteReg(MSCM0, SMARTRF_SETTING_MSCM0); 
  /* Turn on the RC oscillator */
  mrfiSpiWriteReg(WORCTRL, WORACT_SETTING_WORCTRL);
  /*  */
  mrfiSpiWriteReg(MCSM2, SMARTRF_SETTING_MCSM2);
  mrfiSpiWriteReg(WOREVT1, SMARTRF_SETTING_WOREVT1);
  mrfiSpiWriteReg(WOREVT0, SMARTRF_SETTING_WOREVT0);

  /* Critical section necessary for watertight testing and
   * setting of state variables.
   */
  BSP_ENTER_CRITICAL_SECTION(s);

  /* If radio is not asleep, put it to sleep */
  if(mrfiRadioState != MRFI_RADIO_STATE_OFF)
  {
    radioActivityDetected = 0;
    
    mrfiSpiCmdStrobe( SWOR );

    /* Our new state is OFF */
    mrfiRadioState = MRFI_RADIO_STATE_OFF;
  }

  BSP_EXIT_CRITICAL_SECTION(s);
}



void MRFI_Wor_init(void)
{
  /* Set the required registers */
  mrfiSpiWriteReg(MCSM2, SMARTRF_SETTING_MCSM2);
  mrfiSpiWriteReg(WOREVT1, SMARTRF_SETTING_WOREVT1);
  mrfiSpiWriteReg(WOREVT0, SMARTRF_SETTING_WOREVT0);
  mrfiSpiWriteReg(WORCTRL, SMARTRF_SETTING_WORCTRL);
 
  #ifdef ENABLE_INDPNDNT_RCCALIB
  /* Calibrate RC ocillator */
  MRFI_Calib_Wor_Rc_Osc();
  #endif /*ENABLE_INDPNDNT_RCCALIB*/
  
  /* Configure GDO2 pin of Radio - Put it in high impedence state for now */
  mrfiSpiWriteReg(IOCFG2, SMARTRF_SETTING_IOCFG2);
  
  /* Configure MCU pin P2_7 as high impedance pin*/
  MRFI_DISABLE_WOR_PIN_INT();
  MRFI_CONFIG_GDO2_PIN_AS_GPIO();
  MRFI_CONFIG_GDO2_PIN_AS_INPUT();
  MRFI_CLEAR_WOR_PIN_INT_FLAG();
}

void MRFI_WOR_BSP_Gpio_2_7_Isr(void)
{
  /* see if sync pin interrupt is enabled and has fired */
  if (MRFI_WOR_PIN_INT_IS_ENABLED() && MRFI_WOR_PIN_INT_FLAG_IS_SET())
  {
    /*  clear the sync pin interrupt, run sync pin ISR */

    /*
     *  NOTE!  The following macro clears the interrupt flag but it also *must*
     *  reset the interrupt capture.  In other words, if a second interrupt
     *  occurs after the flag is cleared it must be processed, i.e. this interrupt
     *  exits then immediately starts again.  Most microcontrollers handle this
     *  naturally but it must be verified for every target.
     */
    MRFI_CLEAR_WOR_PIN_INT_FLAG();
    MRFI_DISABLE_WOR_PIN_INT();
  
    /*
     * Set the time for which need to remain awake on WOR triggered wake-up
     * ..... need to add the code here...
     */
     
     //if( mrfiRadioState != MRFI_RADIO_STATE_OFF)
     //{
     	/* Set event for SWOR sleep from here*/
     //}
     //else
     {
     	radioActivityDetected = 1;
     	//MRFI_WakeUp();
     	//MRFI_RxOn();
     }
        
  }
  
}

  • Hi

    I'm so sorry, but right now I'm trying also to comprehend how WOR works, without not much sucesful. So I can't help you. :-(

    Have you found where your problem is? Have you found any solution? Perhaps your solution could help me to learn about WOR a bit faster.

    Thanks you in advance!!!