• 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 Proprietary Software & SimpliciTI Forum » [CC2430] Implementing a watch dog timer in ZStack-1.4.3-1.2.1 in power saving mode
Share
Low Power RF & Wireless Connectivity
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

Forums

[CC2430] Implementing a watch dog timer in ZStack-1.4.3-1.2.1 in power saving mode

This question is not answered
GrantHatamosa
Posted by GrantHatamosa
on Mar 06 2009 08:19 AM
Expert1930 points

I am having some issues when I implement a watch dog timer in my application on top of ZStack-1.4.3-1.2.1 in CC2430 when I enable power saving.

To give a brief overview on how i implement my algorithm, during the application's initialization (i.e SampleApp_Init) phase i created a periodic timer event using osal_start_timerEx that will fire every 750ms. After doing so I call the fundtion WatchdogTimerEnable setting it to the maximum setting of 1second.

 

I expect that before the watch dog timer expires my periodic event will first be triggered. And when that event is triggered it will just reset the watch dog timer and restart the periodic timer once again. This sound simple and should work properly. I have confirm this working when i disabled power saving. However, when power saving is enabled I can see that the device will be detected by the coordinator but after sometime it will just reset and loops this way forever.

I would then like to seek any advice from those who have implemented a watch dog timer on their application on top of Zstack-1.4.3-1.2.1 on how you are able to prevent the watch dog from preventing to reset the system on a non-fault scenario.

 

Cheers,

Grant

 

Grant Hatamosa

Senior Software Engineer

wachdog CC2430 ZStack 1.4.3-1.2.1
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • BrandonAzbell
    Posted by BrandonAzbell
    on Mar 15 2009 14:38 PM
    Guru54880 points

    What Power Mode are you setting the device to in the CC2430?

    Please note that if you are in PM3, none of the clocks in the device will be enabled.  This is indicated in Table 38 in the CC2430 Datasheet available on the CC2430 Product Folder.

    Brandon

    CC2430 ZStack 1.4.3-1.2.1 wachdo
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • GrantHatamosa
    Posted by GrantHatamosa
    on Mar 15 2009 18:51 PM
    Expert1930 points

    I'm setting it at PM3..but in the same specification is it also mentioned "13.13.3 Watchdog and Power Modes, In the two lowest power modes, PM2 and PM3, the watchdog is disabled and reset."

    In this case should I not worry about the watchdog timer here as it is disabled during sleep? 

    Are there extra steps that are needed when waking up for the watchdog timer (other than the periodic watchdog clear timer)?

     

    Grant Hatamosa

    Senior Software Engineer

    watchdog
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • BrandonAzbell
    Posted by BrandonAzbell
    on Mar 16 2009 01:10 AM
    Guru54880 points

    Grant

    I'm setting it at PM3..but in the same specification is it also mentioned "13.13.3 Watchdog and Power Modes, In the two lowest power modes, PM2 and PM3, the watchdog is disabled and reset."

    In this case should I not worry about the watchdog timer here as it is disabled during sleep? 

    To my knowledge, implementing what is indicated in Section 13.13.3 of the CC2430 datasheet should be sufficient.  As this section indicates, when the device is in PM2 or PM3, the watchdog timer is not running.  However, it is return to the same state as it was when going from a PM0 or PM1 state to a PM2 or PM3 state, but start counting from zero.

     

    Grant

    Are there extra steps that are needed when waking up for the watchdog timer (other than the periodic watchdog clear timer)?

    Not that I am aware of.

    Brandon

    CC2430 ZStack 1.4.3-1.2.1 wachdo
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • GrantHatamosa
    Posted by GrantHatamosa
    on Mar 16 2009 01:15 AM
    Expert1930 points

    If that is the case, has it ever been tried to enable the wathcdog timer with the ZStack-1.43-1.2.1 and have POWER_SAVING enabled?

    If so, is there a sample application to show how it is done?

    I have reconfigured my algorithm and placed the code to enable and clear the watchdog timer in osal_start_system.

    Here's my modified osal_start_system:

     

    void osal_start_system( void )
    {
    #if !defined ( ZBIT )
      for(;;)  // Forever Loop
    #endif
      {
       uint8 idx = 0;

       // Enable the watchdog timer before entering the main processing loop
      WatchDogEnable(WDTIMX);   

        Hal_ProcessPoll();  // This replaces MT_SerialPoll() and osal_check_timer().   

        do {
          if (tasksEvents[idx])  // Task is highest priority that is ready.
          {
            break;
          }
        } while (++idx < tasksCnt);

        if (idx < tasksCnt)
        {
          uint16 events;
          halIntState_t intState;

          HAL_ENTER_CRITICAL_SECTION(intState);
          events = tasksEvents[idx];
          tasksEvents[idx] = 0;  // Clear the Events for this task.
          HAL_EXIT_CRITICAL_SECTION(intState);

          events = (tasksArr[idx])( idx, events );
          
         // Reset the watchdog timer after every event processed
          WatchDogEnable(WDTIMX);   
         

          HAL_ENTER_CRITICAL_SECTION(intState);
          tasksEvents[idx] |= events;  // Add back unprocessed events to the current task.
          HAL_EXIT_CRITICAL_SECTION(intState);
        }
    #if defined( POWER_SAVING )
        else  // Complete pass through all task events with no activity?
        {
        
       // Reset the watchdog timer before going to sleep
       WatchDogEnable(WDTIMX);   

       osal_pwrmgr_powerconserve();  // Put the processor/system into sleep

       // Reset the watchdog timer after waking up from sleep
       WatchDogEnable(WDTIMX);   
        }
    #endif
        }
    }

     

    Grant Hatamosa

    Senior Software Engineer

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • BrandonAzbell
    Posted by BrandonAzbell
    on Mar 16 2009 11:14 AM
    Guru54880 points

    Grant

    If that is the case, has it ever been tried to enable the wathcdog timer with the ZStack-1.43-1.2.1 and have POWER_SAVING enabled?

    I'm not personally aware, but isn't to say it hasn't been done.  Based on the sample code you provided, it looks reasonable.

    One thing you can add to verify if the watchdog timer is actually resetting the device is to add some checks early on in your application code to read the SLEEP Mode Control register.  Bits[4:3] provide status bits which indicate the cause of the last reset.  If the SLEEP[4:3] = 10b, it indicates a watchdog timer reset.

    Brandon

    CC2430 ZStack 1.4.3-1.2.1 wachdo
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • wazilian
    Posted by wazilian
    on Nov 03 2009 10:52 AM
    Prodigy140 points

    Grant,

    I'm curious. Are you still setting a timer (osal_start_timerEx) in your AppInit with your modified osal_start_system? Or are you just effectively configuring and clearing the Watchdog with your 2 calls to WatchDogEnable in your osal_start_system?

    Thanks!

    wazilian - King of Wazil

    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