• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Low Power RF & Wireless Connectivity » Low Power RF Bluetooth® Low Energy & ANT Forum » How to enter Power mode 1 in CC2540 (urgent)?
Share
Low Power RF & Wireless Connectivity
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

Forums

How to enter Power mode 1 in CC2540 (urgent)?

This question is not answered
Micfox Micfox
Posted by Micfox Micfox
on Jul 31 2012 00:29 AM
Prodigy240 points

This question has been asked but there is not workable solution to it.  Therefore, I need to ask it again:

I am developing my own application based on the Keyfob-demo project.   It  is expected that the keyfob (peripheral) is supposed to measure the RSSI between the master and itself after a given period of sampling time. During the sampling time, the keyfob should go into sleep ( power mode 1 is sufficient but if it can go into the power mode 2, it would be better). I have the following codes for the rssi sampling section ( it was in a event handling process. The flag value for this event  is KFD_RSSI_READ_EVT_T):

.....

  rssi_sampling_counter = 0;
      uint16 simpleBLEConnHandle;
      
      //halSleep(10);
    
    GAPRole_GetParameter(GAPROLE_CONNHANDLE,&simpleBLEConnHandle);

     HCI_ReadRssiCmd(simpleBLEConnHandle );
     
       #if defined ( POWER_SAVING )
        osal_pwrmgr_device( PWRMGR_BATTERY );
      #endif
     
         osal_stop_timerEx( keyfobapp_TaskID,  KFD_START_DEVICE_EVT);
        osal_stop_timerEx( keyfobapp_TaskID,KFD_BATTERY_CHECK_EVT);
        osal_stop_timerEx( keyfobapp_TaskID, KFD_ACCEL_READ_EVT);
        osal_stop_timerEx( keyfobapp_TaskID, KFD_TOGGLE_BUZZER_EVT);
        osal_stop_timerEx( keyfobapp_TaskID, KFD_ADV_IN_CONNECTION_EVT);
        osal_stop_timerEx( keyfobapp_TaskID, KFD_PERIODIC_EVT);
        osal_stop_timerEx( keyfobapp_TaskID, KFD_RSSI_READ_EVT_T);
        osal_stop_timerEx( keyfobapp_TaskID, KFD_BUTTON_EVT);
   
     
     
     
          halSleep(10);
     
   osal_start_timerEx(keyfobapp_TaskID,KFD_RSSI_READ_EVT_T, rssi_sampling_period);

.....

I have tried to terminate all the timer evenst in the keyfob demo application layer except the rssi sampling one before it goes into sleep. However,  there is still some peaks showing up in every 200 - 300 ms according to the oscilloscope graph. I read the past threads on this issue and some users suggested that the keyfob can only go to sleep where there is no active tasks on-hold. But in my case, the RSSI sampling timer cannot be stopped, right? Otherwise, how can the keyfob knows when to measure the rssi value?  So does it mean the keyfob can never go into the power mode 1 in my case? I am deperately looking for help on this issue. Please advise and I will appreciate any constructive response to my urgent request. Thanks.

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Micfox Micfox
    Posted by Micfox Micfox
    on Jul 31 2012 01:07 AM
    Prodigy240 points

    additionally, I have turned on the POWER_SAVING macro in the compiling environment  to enable the power saving functions.  But it still cannot enter the power mode 1. Please advise.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Igor Sherer
    Posted by Igor Sherer
    on Jul 31 2012 02:52 AM
    Guru21965 points

    Hi,

    1. What is the value of rssi_sampling_period
    2. For debugging purposes, can you disable KFD_RSSI_READ_EVT_T scheduling
      and check whether you still getting these peaks on oscope? 

    Br,

    Igor

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Micfox Micfox
    Posted by Micfox Micfox
    on Aug 01 2012 00:19 AM
    Prodigy240 points

    question 1 - it depends on what the master set. It is changed in the test. Currently, it is 10 seconds.

    question 2 - I have commented that line. I still get those peaks at the period of 100 ms.

    I wonder if there is anything running underneath about the rssi sampling for those peaks on the oscilloscope?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Micfox Micfox
    Posted by Micfox Micfox
    on Aug 07 2012 00:12 AM
    Prodigy240 points

    I use the following macro to force the node into the power mode 2. However, it will make the connection drop:

    In hal_sleep.h:

    #define HAL_SLEEP_SET_POWER_MODE( mode )                                       \
      st( SLEEPCMD &= ~PMODE;                                                      \
          SLEEPCMD |= (mode);                                                      \
          while (!(STLOAD & LDRDY));                                               \
          {                                                                        \
            halSetSleepMode();                                                     \
          }                                                                        \
        )
    #else // HAL_SLEEP_DEBUG_POWER_MODE

    // Debug: Don't set power mode, just block until sleep timer interrupt.
    #define HAL_SLEEP_SET_POWER_MODE( mode )                                       \
      st( while( halSleepInt == FALSE );                                           \
          halSleepInt = FALSE;                                                     \
        )

    #endif // !HAL_SLEEP_DEBUG_POWER_MODE

    Then in the  function  - static void peripheralStateNotificationCB( gaprole_States_t newState )

    static void peripheralStateNotificationCB( gaprole_States_t newState )

    {

    .....
      if ( gapProfileState != newState )
      {
        switch( newState )

     {

        case GAPROLE_STARTED:

    ....

    case GAPROLE_CONNECTED:

     #if defined ( POWER_SAVING )
            osal_pwrmgr_device( PWRMGR_BATTERY );
             osal_pwrmgr_powerconserve();
          #endif
                   
            //  ProxReporter_SetParameter(PP_FLIGHT_MODE_NOTIFICATION,sizeof(uint8), &flight_mode_enabled);

            osal_stop_timerEx( keyfobapp_TaskID,  KFD_START_DEVICE_EVT);
            osal_stop_timerEx( keyfobapp_TaskID,KFD_BATTERY_CHECK_EVT);
            osal_stop_timerEx( keyfobapp_TaskID, KFD_ACCEL_READ_EVT);
            osal_stop_timerEx( keyfobapp_TaskID, KFD_TOGGLE_BUZZER_EVT);
            osal_stop_timerEx( keyfobapp_TaskID, KFD_ADV_IN_CONNECTION_EVT);
            osal_stop_timerEx( keyfobapp_TaskID, KFD_PERIODIC_EVT);
            osal_stop_timerEx( keyfobapp_TaskID, KFD_RSSI_READ_EVT_T);
            osal_stop_timerEx( keyfobapp_TaskID, KFD_BUTTON_EVT);
            /*
              if (gapProfileState ==GAPROLE_CONNECTED)
            {
                     halSleep(100);
              GAPRole_TerminateConnection();
      //        putchar ('t');
            }
            */
             
             
            halSleep(1000);
                   
                   
      HAL_SLEEP_SET_POWER_MODE( HAL_SLEEP_TIMER  );

    osal_start_timerEx(keyfobapp_TaskID,KFD_RSSI_READ_EVT_T, rssi_sampling);
       
      

    }

    ....

    }

    My question is simple - Please advise whether the bluetooth connection can be held or not when the keyfob (slave) goes to  the power mode 2???

    If yes, please advise why the connection is broken. If no, please advise how to get the button press interrupt (on the keyfob) to trigger the reconnection. Thanks.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Micfox Micfox
    Posted by Micfox Micfox
    on Aug 12 2012 00:03 AM
    Prodigy240 points

    Please advise... I need the power mode 2 workable urgently.  The TI staff asked me to post my question on the TI forum but actually no TI staff  is answering it???

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use