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.

WAKE-on-RADIO Example

Other Parts Discussed in Thread: SIMPLICITI

Hello

I'm trying to implementing a SimpliciTI example using Wake-on-Radio (WOR). I've been exploring all SimpliciTI forums trying to find and example or similar but I have found nothing. Actually, I can't understand how is possible that none example about this functionality is published. I know that SimpliciTI doesn't support WOR, but this functionality is, I think, very important in low power devices.

Nobody has any WOR example? Or similar? I'm trying to make a WOR example, but my radio doesn't wake up never!!!

Thanks you in advance.

Regards

 

  • Well, it looks like nobody has an example about WOR. So, I'm going to try make this example for futures newbies like me.

    To create this example, I've used a bit of code extracted from this other thread. I've to prevent you that right now this example doesn't work: the radio doesn't wake up when receiving packets.

    My code used is:

    // DEFINES-------------------
    #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 WORACT_SETTING_WORCTRL    0x78 /*0x38*/
    #define RCCALIB_SETTING_WORCTRL    0x70 /*0x30*/
    #define WORACT_SETTING_IOCFG0   0x24
    #define WORDIS_SETTING_IOCFG0    0x06

     void MRFI_WOR_init(void)
    {
        // Configuro los registros del Wor
        mrfiSpiWriteReg(MCSM2, SMARTRF_SETTING_MCSM2);
        mrfiSpiWriteReg(WOREVT1, SMARTRF_SETTING_WOREVT1);
        mrfiSpiWriteReg(WOREVT0, SMARTRF_SETTING_WOREVT0);
        mrfiSpiWriteReg(WORCTRL, SMARTRF_SETTING_WORCTRL);
    }

    void MRFI_WOR_Sleep(void)
    {
        bspIState_t s;

          // Turn off the radio
         MRFI_Sleep();

          // GDO0 to receive WOR interruptions
          mrfiSpiWriteReg(IOCFG0, WORACT_SETTING_IOCFG0);
             
          mrfiSpiWriteReg(WORCTRL, WORACT_SETTING_WORCTRL);
          mrfiSpiWriteReg(MCSM2, SMARTRF_SETTING_MCSM2);
          mrfiSpiWriteReg(WOREVT1, SMARTRF_SETTING_WOREVT1);
          mrfiSpiWriteReg(WOREVT0, SMARTRF_SETTING_WOREVT0);
    }

    Using the example main_AP_async, I'm trying to do this:

    1) After stablish the connection with a ED, and receive the first message, I enter in WOR mode
    2) I'll be in WOR mode until receive a second message. This second message would wake up my AP
    3) A third received message would make enter the AP in WOR mode, and restart the process one more time.

    My main particularity, is I'm trying to use the same GDO pin as my Sync signal, and my WOR signal. To make this distinction, in the file mrfi_board.c, in the function BSP_GpioPort1Isr, I've realised this modification:

    BSP_ISR_FUNCTION( BSP_GpioPort1Isr, PORT2_VECTOR )
    {
      /*
       *  This ISR is easily replaced.  The new ISR must simply
       *  include the following function call.
       */
       if (mrfiRadioState == MRFI_RADIO_STATE_OFF){
               // If RX is off, we're in WOR mode: Wake up the radio
               MRFI_WakeUp();
       }
       else{
              MRFI_GpioIsr();
       }
    }

    But my radio never is awake. What's the error? Could you help me? Any suggestion will be welcome.

    Thanks you in advance.

    Regards

  • Any idea???

    Thanks you

  • I would like to see a working example of this too!

    1 second polling + Wake on radio.

     

    TI, please?

  • This night I will show you my example. I think it's a bit rude, but it works!

  • Hi

    This are my functions to switch into WOR mode:

    //to turn into WOR mode

    // every 2 seconds, the radio wakes up

    void MRFI_WOR_Sleep(void)
    {
        mrfiSpiWriteReg(WORCTRL, 0x79);
        mrfiSpiWriteReg(WOREVT1, 0x08);
        mrfiSpiWriteReg(WOREVT0, 0x76);
        mrfiSpiWriteReg(MCSM2, 0x02);
        mrfiSpiWriteReg(MCSM0, 0x18);
        mrfiSpiWriteReg(MCSM1, 0x04);
           
        MRFI_CLEAR_GDO2_INT_FLAG();

        MRFI_CLEAR_GDO0_INT_FLAG();
        mrfiSpiCmdStrobe( SWOR );

        wakeonradio=1;

    }

    // to exit from WOR mode: this function must be called from the interrupt

    void MRFI_WOR_exit(void)
     {
         MRFI_CLEAR_WOR_PIN_INT_FLAG();
     
        mrfiSpiCmdStrobe(SIDLE);         // go to IDLE
        mrfiSpiCmdStrobe(SRX);           // strobe to RX state
     }

    So, in the interrupt launched when receiving a packet (this is BSP_ISR_FUNCTION( BSP_GpioPort1Isr, PORT1_VECTOR ) ) you must do this:

    BSP_ISR_FUNCTION( BSP_GpioPort1Isr, PORT1_VECTOR )
    {
      /*
       *  This ISR is easily replaced.  The new ISR must simply
       *  include the following function call.
       */
              stado=mrfiSpiReadReg(PKTSTATUS);

              if (wakeonradio==1){
                  wakeonradio=0;
                  stado=mrfiSpiReadReg(PKTSTATUS);
                  MRFI_CLEAR_GDO0_INT_FLAG();
                  MRFI_WOR_exit();
                  MRFI_Init();
                  MRFI_RxOn();
              }     
              MRFI_GpioIsr();     

    }

    wakeonradio is a global variable I use to know if I'm in WOR mode. At this way, if the interrupt BPS_Gpio1Isr is launched, and wakeonradio=1, I know I must wake up the radio chip before continue processing packets.

    To wake up your receptor, just do your tx send a lot of continuos tx for several seconds. Normally, I transmits for the double time of my wor time.

    I hope this example helps you. I know it's a bit rude, but it's the best I could do

    Regards

  • Thanks. I'm trying to run your code, what #includes do I need?

  • Well, actually I've modified mrfi_radio.c to include my two functions to wake and wor-sleep. So you don't have any includes, just add my functions into mrfi_radio.c

    Regards

  • Do I replace BSP_ISR_FUNCTION( BSP_GpioPort1Isr, PORT1_VECTOR ) in mrfi_board.c?

  • Yes. Just add          

           if (wakeonradio==1){
                  wakeonradio=0;
                  stado=mrfiSpiReadReg(PKTSTATUS);
                  MRFI_CLEAR_GDO0_INT_FLAG();
                  MRFI_WOR_exit();
                  MRFI_Init();
                  MRFI_RxOn();
              }   

    into the ISR of file mrfi_board.c

     

  • Hey, I'm still not having any luck running your code.

     

    Could you please send me a complete project with the modded drivers and both end device code and access point code?

    my email is: mtaylor1{@}gmail.com

     

    Any working example will help thanks.

  • Hi

    Sorry for reply you so late. At this time I'm not able to send you any example. Perhaps tonight if you continue having problems, but please, try to compile for yourself. It's not difficult.

    As I said you, you only have to modify the example "AP as Data Hub" with the modifications I've described you. Could you say my what are the compile errors you're having? Probably it must be a very tiny error.

    Regards

     

  • Hey I found another code to use WOR.

     

    I have made a program for the end device to enter WOR mode, where it checks for a packet every 1 second.

    Once it receives the packet, the variable WOR_Enable is set to 0, and the main() is called.

     

    When main() is called the 2nd time it bypasses the WOR setup and it enters normal mode.

    In the normal mode, the access point can send a message (press 1) and the end device will send a reply saying "WORKING"

    To return to WOR mode, press 5. The end device then sets WOR_Enable = 1 and calls main().

     

    I am recalling main() so the device reinitializes with the WOR settings. I had to do this so that i could communicate with the device in "normal mode"

    I am having a few problems.

    - MRFI_Transmit does not work to transmit "IMAWAKE" after I enable normal mode

    - When I press 5 to set the end device back to WOR, it just locks it up.

     

    Please help me fix these problems

     

     

     

    --------------------------------------------------------------------------------Here is  the END DEVICE code-------------------------------------------------------------------------------------------------------

    //Matt Taylor
    //Based on msp430x22x4_adc10_02.c

    #include "msp430x22x4.h"

    #include "radios/family1/mrfi_spi.h"
    #include "mrfi.h"
    uint8_t index_output = 9;
    mrfiPacket_t packetToSend;
    int i;

    void wor_init();
    void wor_start();
    void wor_stop();

    int WOR_Enabled=1;      //Controls whether the device is in sleepmode (WOR=1) or in regular mode (WOR=0)
    void MCU_Init(void);

    //-------------------------MAIN-------------------------------------------------
    void main(void)
    {
      WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
      MCU_Init();
     
    //--------------------Code from Chat program---------- 
      BSP_Init();
      MRFI_Init();
      P1DIR |= 0x03;
      P3SEL    |= 0x30;     // P3.4,5 = USCI_A0 TXD/RXD
      UCA0CTL1  = UCSSEL_2; // SMCLK
      UCA0BR0   = 0x41;     // 9600 from 8Mhz
      UCA0BR1   = 0x3;
      UCA0MCTL  = UCBRS_2;                    
      UCA0CTL1 &= ~UCSWRST; // Initialize USCI state machine
      IE2      |= UCA0RXIE; // Enable USCI_A0 RX interrupt
      MRFI_WakeUp();
      MRFI_RxOn();
      index_output=0;

    //---------------------Enable Wake on Radio---------- 
      if (WOR_Enabled==1)  {
      wor_init();
      wor_start();
      char output[] = {"\r\nEntering Sleep Mode"};
      TXString(output, (sizeof output)-1);
      }
     
    //---------------------Wake on Radio is Disabled----------   
    //--Tell the access point that WOR packet was recieved----
      if (WOR_Enabled==0){
       
      char output[] = {"\r\nEntering Normal Mode"};
      TXString(output, (sizeof output)-1);
     
     
      mrfiPacket_t reply_packet;
      reply_packet.frame[0]=28;
     
      for(i=9;i<29;i++)  {    reply_packet.frame[i]=' ';     }
     
      reply_packet.frame[9]='\r';
      reply_packet.frame[10]='\n';
      reply_packet.frame[11]='I';
      reply_packet.frame[12]='M';
      reply_packet.frame[13]='A';
      reply_packet.frame[14]='W';
      reply_packet.frame[15]='A';
      reply_packet.frame[16]='K';
      reply_packet.frame[17]='E'; 
       
      MRFI_Transmit(&reply_packet, MRFI_TX_TYPE_FORCED);
      }
     
      __bis_SR_register(GIE+LPM4_bits);
    //----------------------------------------------------
    }//end main


    //-------------------------MCU INITIATE-----------------------------------------
    void MCU_Init()
    {
      BCSCTL1 = CALBC1_8MHZ;                    // Set DCO
      DCOCTL = CALDCO_8MHZ;
     
      BCSCTL3 |= LFXT1S_2;                      // LFXT1 = VLO
      TACCTL0 = CCIE;                           // TACCR0 interrupt enabled
      TACCR0 = 12000;                           // ~1 second
      TACTL = TASSEL_1 + MC_1;                  // ACLK, upmode
     
      P3SEL |= 0x30;                            // P3.4,5 = USCI_A0 TXD/RXD
      UCA0CTL1 = UCSSEL_2;                      // SMCLK
      UCA0BR0 = 0x41;                           // 9600 from 8Mhz
      UCA0BR1 = 0x3;
      UCA0MCTL = UCBRS_2;                      
      UCA0CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**
      IE2 |= UCA0RXIE;                          // Enable USCI_A0 RX interrupt
      __enable_interrupt();
    }
     

    //-------------------------ISRs GO HERE------------------------------------------
    void MRFI_RxCompleteISR()
    {
      mrfiPacket_t packet;
     
      if (WOR_Enabled==1)
        wor_stop();
     
      MRFI_Receive(&packet);
      char received[] = {"\r\nWOR Packet Received"};
     
      if (WOR_Enabled==1)
      {
      if ((MRFI_P_PAYLOAD(&packet))[2]==65) {
        TXString(received, (sizeof received)-1);
        P1OUT &= ~0x02;
        WOR_Enabled=0;
        main();   //Restart main program with WOR disabled
      }
      else {
        MRFI_WakeUp();
        MRFI_RxOn();
      }
     
      }
      else    //Wake on radio disabled
      {
       
        uint8_t i;
        P1OUT ^= 0x02;

    //-------------------Setup Return Packets---------
      mrfiPacket_t reply_packet;
      reply_packet.frame[0]=28;
      mrfiPacket_t reply_sleep;
      reply_sleep.frame[0]=28;  
      for(i=9;i<29;i++)
      {
           reply_packet.frame[i]=' ';       
           reply_sleep.frame[i]=' ';          
         }
     
      reply_packet.frame[9]='\r';
      reply_packet.frame[10]='\n';
      reply_packet.frame[11]='W';
      reply_packet.frame[12]='O';
      reply_packet.frame[13]='R';
      reply_packet.frame[14]='K';
      reply_packet.frame[15]='I';
      reply_packet.frame[16]='N';
      reply_packet.frame[17]='G';  

      reply_sleep.frame[9]='\r';
      reply_sleep.frame[10]='\n';
      reply_sleep.frame[11]='G';
      reply_sleep.frame[12]='O';
      reply_sleep.frame[13]='O';
      reply_sleep.frame[14]='D';
      reply_sleep.frame[15]='B';
      reply_sleep.frame[16]='Y';
      reply_sleep.frame[17]='E';  

      MRFI_Receive(&packet);
       

      for (i=9;i<29;i++)   {
        if (packet.frame[i-3]=='W' && packet.frame[i-2]=='A' && packet.frame[i-1]=='K' && packet.frame[i]=='E')
        {
          P1OUT ^= 0x03;
          MRFI_Transmit(&reply_packet, MRFI_TX_TYPE_FORCED);  
        }

        if (packet.frame[i-4]=='S' && packet.frame[i-3]=='L' && packet.frame[i-2]=='E' && packet.frame[i-1]=='E' && packet.frame[i]=='P')
        {
          P1OUT ^= 0x03;
          MRFI_Transmit(&reply_sleep, MRFI_TX_TYPE_FORCED);     
          //Turn off MCU and enable WOR
          WOR_Enabled=1;
          main();
        }
       
      }//END FOR
       
      }


     
    }

    //----------------------- WAKE ON RADIO ----------------------------------------
    void wor_init()
    {   
      uint8_t reg;
      /* choose EVENT0 (=(uint16_t)(WOREVT1<<8)+WOREVT10)   == 3600=0x0E10 (103.5ms) */
      mrfiSpiWriteReg(WOREVT1, 0x88);
      mrfiSpiWriteReg(WOREVT0, 0x87);
      /* choose EVENT1[WORCTRL.6-4]                         == 7=0b111        */
      reg  = mrfiSpiReadReg(WORCTRL);
      reg |=  0x70;
      mrfiSpiWriteReg(WORCTRL, reg);
      /* enable frequence calibration RC_CAL[WORCTRL.3]     == 1              */
      reg  = mrfiSpiReadReg(WORCTRL);
      reg |=  0x80;
      mrfiSpiWriteReg(WORCTRL, reg);
      /* choose WOR_RES[WORCTRL.1-0]                        == 00             */
      reg  = mrfiSpiReadReg(WORCTRL);
      reg &= ~0x03;
      mrfiSpiWriteReg(WORCTRL, reg);
      /* choose when to calibrate FS_AUTOCAL[MCSM0.5-4]     == 01             */
      reg  = mrfiSpiReadReg(MCSM0);
      reg &= ~0x20;
      reg |=  0x10;
      mrfiSpiWriteReg(MCSM0, reg);
      /* initial filter by rssi RX_TIME_RSSI[MCSM2.4]       == 0              */
      reg  = mrfiSpiReadReg(MCSM2);
      reg &= ~0x10;
      mrfiSpiWriteReg(MCSM2, reg);
      /* stay in Rx after preamble RX_TIME_QUAL[MCSM2.3]    == 0              */
      reg  = mrfiSpiReadReg(MCSM2);
      reg &= ~0x08;
      mrfiSpiWriteReg(MCSM2, reg);
      /* enable RC oscilator RC_PD[WORCTRL.7]               == 0              */
      reg  = mrfiSpiReadReg(WORCTRL);
      reg &= ~0x80;
      mrfiSpiWriteReg(WORCTRL, reg);
      /* assert GDO2 at SYNC GDO2_CFG[IOCFG2.5-0]           == 0x06           */
      mrfiSpiWriteReg(IOCFG2, 0x06);          //P14=SYNC
    }
    void wor_start()
    {
      /* choose RX_TIME[MCSM2.2-0]                          == 2=0b010        */
      uint8_t reg  = mrfiSpiReadReg(MCSM2);
      reg &= ~0x05;
      reg |=  0x02;
      //mrfiSpiWriteReg(MCSM2, reg);//test
      mrfiSpiWriteReg(MCSM2, 2);//test
      /* from IDLE state, enter WOR */
      MRFI_RxIdle();
      MRFI_RxWor();
    }
    void wor_stop()
    {  
      /* choose RX_TIME[MCSM2.2-0]                          == 7=0b111        */
      uint8_t reg  = mrfiSpiReadReg(MCSM2);
      reg |=  0x07;
      //mrfiSpiWriteReg(MCSM2,reg);
      mrfiSpiWriteReg(MCSM2,7);//test
      /* turn radio to IDLE, quitting WOR*/
      MRFI_RxIdle();
    }

     

     

     

    --------------------------------------------------------------------------------Here is  the ACCESS POINT code-------------------------------------------------------------------------------------------------------

    #include "radios/family1/mrfi_spi.h"
    #include "mrfi.h"
    uint8_t index_output = 9;
    mrfiPacket_t packetToSend;
    void wakeOnRadio();

    int main(void)
    {
      BSP_Init();
      MRFI_Init();
      P3SEL    |= 0x30;     // P3.4,5 = USCI_A0 TXD/RXD
      UCA0CTL1  = UCSSEL_2; // SMCLK
      UCA0BR0   = 0x41;     // 9600 from 8Mhz
      UCA0BR1   = 0x3;
      UCA0MCTL  = UCBRS_2;                    
      UCA0CTL1 &= ~UCSWRST; // Initialize USCI state machine
      IE2      |= UCA0RXIE; // Enable USCI_A0 RX interrupt
      MRFI_WakeUp();
      MRFI_RxOn();
      index_output=0;
     
      TXString( "\r-----eFish Experiment-----", 30 );
      TXString( "\r\nWhat would you like to do?", 30 );
      TXString( "\r\n (0) Wakeup experimental", 26 );
      TXString( "\r\n (1) To wake up device", 25 );
      TXString( "\r\n (5) To put device to sleep", 30 );
      TXString( "\r\n", 3 );

      __bis_SR_register(GIE+LPM4_bits); 
    }
    void MRFI_RxCompleteISR()
    {
      uint8_t i;
      P1OUT ^= 0x02;
      mrfiPacket_t packet;
      MRFI_Receive(&packet);
      char output[] = {"                   "};

      for (i=9;i<60;i++) {
        output[i-9]=packet.frame[i];
      }
      TXString(output, (sizeof output));

     
    }

    #pragma vector=USCIAB0RX_VECTOR
    __interrupt void USCI0RX_ISR(void)
    {
     
      char rx = UCA0RXBUF;
      uint8_t i;
      packetToSend.frame[index_output]=rx;
      index_output++;
     
    //----------------------Setup Packets------------------------------------------ 
      mrfiPacket_t wake_packet;
      wake_packet.frame[0]=28;

      mrfiPacket_t sleep_packet;
      sleep_packet.frame[0]=28; 
     
      for(i=9;i<29;i++) {
           wake_packet.frame[i]=' ';
           sleep_packet.frame[i]=' ';      
         }

      wake_packet.frame[9]='W';
      wake_packet.frame[10]='A';
      wake_packet.frame[11]='K';
      wake_packet.frame[12]='E';
     


      sleep_packet.frame[9]='S';
      sleep_packet.frame[10]='L';
      sleep_packet.frame[11]='E';
      sleep_packet.frame[12]='E';
      sleep_packet.frame[13]='P';
     
    //----------------------------------------------------------------------------- 
     
      if (rx=='1')
      {
         MRFI_Transmit(&wake_packet, MRFI_TX_TYPE_FORCED); 
         P1OUT ^= 0x01;
      }
       
     
      if (rx=='5')
      {
         MRFI_Transmit(&sleep_packet, MRFI_TX_TYPE_FORCED); 
         P1OUT ^= 0x01;
      }
        if (rx=='0')
      {
         wakeOnRadio();
         P1OUT ^= 0x01;
      }
     
    }
    //-----------------------------------------------------------------------------
    void wakeOnRadio(){
       P1IFG &= ~0x04;
      int counter;
      mrfiPacket_t packetToSend;
      MRFI_SET_PAYLOAD_LEN((&packetToSend),20);
     
      P1OUT ^= 0x01;
      for (counter=500;counter>=1;counter--)
      {
         (MRFI_P_PAYLOAD(&packetToSend))[2] = 65;
         MRFI_Transmit(&packetToSend, MRFI_TX_TYPE_FORCED);
      }
      P1OUT ^= 0x01;
     
    }

  • Hi Matt,

    I did not analyze your code in detail, but it is definitely wrong to call main() by yourself. This is a recursion which finally overflows the stack and let the processor crash.

    regards

    spachner

  • How else should i approach this problem?

    I had to call main() because after I ran wor_init() I was unable to cancel the changes it made to the radio setup for when I wanted wor disabled.

    I figured if i "restarted" the program with wor disabled it would behave the way i wanted.

  • It's simplier than you thinks.

    If you study my code, you could view this section:

              if (wakeonradio==1){
                  wakeonradio=0;
                  stado=mrfiSpiReadReg(PKTSTATUS);
                  MRFI_CLEAR_GDO0_INT_FLAG();
                  MRFI_WOR_exit();
                  MRFI_Init();
                  MRFI_RxOn();
              }     

    Calling the function MRFI_WOR_exit(), that you have to add to the file mrfi_radio.c.

    This code allows you exit from WOR mode when receiving an interruption in the PORT1, such for example happens when you receive a frame of the radio. To wake up the radio you must send it a lot of txs. When the radio wakes-up, this interruption will be executed, and with the first frame received, if wakeonradio==1, the changes you need to exit WOR mode will be executed.

    I hope this help you

     

  • hello, I'm a totally newbie in microcontroller programming, i've read some documentation on the TI website but i didn't get how to program a WOR example on a eZ430-RF2500 microcontroller. 

    Where can i find a funcionally example with comments?

    Thanks bye

  • Hi

    There aren't examples or tutorials about WOR (at least not on a MSP) and SimpliciTI because until I now, SimpliciTI wasn't designed to support natively WOR. So we could consider WOR as an advanced functionality. If you are totally new in SimpliciTI and MSPs, I suggest you to study the best you can all the four example codes that SimpliciTI includes. Do several tests and think why the example works.

    After this step, you must read the Application Note about SimpliciTI: http://www.google.es/url?sa=t&source=web&ct=res&cd=1&ved=0CAYQFjAA&url=http%3A%2F%2Ffocus.ti.com%2Flit%2Fan%2Fswra126b%2Fswra126b.pdf&rct=j&q=wake+on+radio+application+note&ei=idjSS9nVC9SJOP2zyYAO&usg=AFQjCNGSqAt-H5KE6C0pSYsOZoUL_Yrb8Q to understand what's WOR and how runs.

    And finally, you could try to addapt the example code I wrote several messages before. Its a bit rude, but works! I think I described clearly what are the modifications one must do, but you must understand how and why SimpliciTI works. If you have any question, you could ask me.

    I hope this help. Bon courage!!!

  • Hello -

    I can comment on the initial interest in WOR that started this thread: "...WOR, but this functionality is, I think, very important in low power devices."

    First, realize that WOR is not free - it consumes a lot of power. There is no black magic circuitry that consumes no power and then gets stimulated by RSSI energy. The radio is constantly waking up by itself and trying to detect channel energy - specifically I think that I remember that it will be looking for preambles.

    Anyway, careful studies have shown  that WOR wastes much more power than a carefully designed network TDMA or beacon type interval. Thus the ultimate power savings is in your hands to balance the trade-offs between longer and longer off times which will require longer and longer awake times to account for maximum expected clock drift at 40 ppm times two (or more, depending on topology) and thus guarantee seeing the re-sync beacon or whatever you design. I strongly suspicion this is why you don't see anything about WOR - it is simply not a useful feature for what would be its intended purpose ... lowest possible power consumption over time for a very low duty cycle sensor node.

     

  • Hi

    Dirty Harry, do you have the study you say? I'm not pretty sure about your affirmation that "simply not a useful feature" and I would like investigate it in more depth.

    I've not done any complete study, but when I was able to make my devices working with WOR, I analysed the consommation with an oscilloscope and I doing many simple calculs, I determined that waking-up my device every 3 seconds severals milliseconds, my device would be able to run with two AA batteries for 1,5 years (in theory). So, at least from the point of view of power saving, would be interesting.

    Before to finish: I don't understand very well the problem in clock drift you say. If I understood you, you said that although my device is able to use the WOR feature, after several months could not be able to wake-up when sending it signals???

    Thanks you

  • thanks matt, i've tried your code but i encountred some problems, i've written in your thread.

    Thank you all

  • I know this is an old thread, but for the record I have tried @ardoster's code with SimpliciTI 1.0.6 and it works fine, with one caveat -- you must enable the GDO0 interrupt in the MSP430. I did this in MRFI_WOR_Sleep() just before I issue the SWOR strobe.

    Without this interrupt being enabled, the MCU never detects the WOR wake-up.

    I also save (in MRFI_WOR_Init()) and restore (in MRFI_WOR_exit()) the state of the WOR registers so that I can be sure the radio state is exactly the way SimpliciTI expects it. I'm not sure this is strictly necessary, but I did notice that, e.g., MCSM1 and MCSM2 were initialized in SimpliciTI to different values than in @ardoster's code.

     

  • I am facing weird problem with the code posted by Adorstar. The code seems to work very good in close range but when i take it beyond a particular distance the code does not work. And then even if i bring back the device the code stops responding. Please help...

  • Hi

    Yes, definitely this is a very old thread. When I wrote this code, I didn't find examples about how to implement a WOR system. Right now, I'm very disconnected about SimpliciTI and all other things related to, but reading your answers, it looks like there's not examples yet.

    Ruchik: Are you using the encryption support in your communications? If yes, try to disable it. And tell me. I'll try to give you later a more serious explanation about that problem, but before, I need to know if you are using the encryption support.

    Regards

     

     

  • Thanks for the reply.

    I am not using any sort of encryption in my code.

  • Sorry my late reply.

    If you're pretty sure you have uncommented the #define that enables SimpliciTI's encryption, I have no explanation about your problem. I have been thinking for a while about your problem, but that has no sense to me.

    Sorry I can't help you. Try to check if all your settings are correct, or try with another values to wake up or similar. I don't remember right now very well.

    If you find a solution, tell me.

  • can you upload your zip file of your code. It might be helpful for me to cross verify my code. Thanks in advance.