This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Proper way to use long period timer

Hi teams,

During development, I need quite a long period timer for hours.

Searching for the subject, I found application timer can only handle few minutes because of 24bit register.

Is there other proper way to get longer timer?

Parents
  • Hi,

    you can change APP_TIMER_CONFIG_RTC_FREQUENCY in sdk_config.h (for example, value 31 gives you 1024 ticks/sec and maximum time about 4.5 hours).

  • Increasing APP_TIMER_CONFIG_RTC_FREQUENCY will reduce the resolution of the timer, and thus also the accuracy. Other than that, I do not know of any other impacts of changing this config.

  • I couldn't tested the setting.

    In app_config.h, it already defined as 0, and if I changed it, compiler shows the following error.

    11> Compiling ‘model_common.c’
    11> In file included from ../../mesh/core/include/utils.h:46,
    11>                  from ../../models/model_spec/common/include/model_common.h:42,
    11>                  from C:\Users\firebird\Documents\SEGGER Embedded Studio for ARM Projects\nRF52\nRF5_SDK_for_Mesh\models\model_spec\common\src\model_common.c:38:
    11> ../../../nRF5_SDK/components/libraries/util/app_util.h:219:41: error: static assertion failed: "unspecified message"
    11> ../../../nRF5_SDK/components/libraries/util/app_util.h:242:62: note: in definition of macro '_SELECT_ASSERT_FUNC'
    11> ../../../nRF5_SDK/components/libraries/util/app_util.h:259:25: note: in expansion of macro 'STATIC_ASSERT_SIMPLE'
    11> ../../mesh/core/api/nrf_mesh_assert.h:99:37: note: in expansion of macro 'STATIC_ASSERT'
    11> C:\Users\firebird\Documents\SEGGER Embedded Studio for ARM Projects\nRF52\nRF5_SDK_for_Mesh\models\model_spec\common\src\model_common.c:66:1: note: in expansion of macro 'NRF_MESH_STATIC_ASSERT'
    Build failed

Reply
  • I couldn't tested the setting.

    In app_config.h, it already defined as 0, and if I changed it, compiler shows the following error.

    11> Compiling ‘model_common.c’
    11> In file included from ../../mesh/core/include/utils.h:46,
    11>                  from ../../models/model_spec/common/include/model_common.h:42,
    11>                  from C:\Users\firebird\Documents\SEGGER Embedded Studio for ARM Projects\nRF52\nRF5_SDK_for_Mesh\models\model_spec\common\src\model_common.c:38:
    11> ../../../nRF5_SDK/components/libraries/util/app_util.h:219:41: error: static assertion failed: "unspecified message"
    11> ../../../nRF5_SDK/components/libraries/util/app_util.h:242:62: note: in definition of macro '_SELECT_ASSERT_FUNC'
    11> ../../../nRF5_SDK/components/libraries/util/app_util.h:259:25: note: in expansion of macro 'STATIC_ASSERT_SIMPLE'
    11> ../../mesh/core/api/nrf_mesh_assert.h:99:37: note: in expansion of macro 'STATIC_ASSERT'
    11> C:\Users\firebird\Documents\SEGGER Embedded Studio for ARM Projects\nRF52\nRF5_SDK_for_Mesh\models\model_spec\common\src\model_common.c:66:1: note: in expansion of macro 'NRF_MESH_STATIC_ASSERT'
    Build failed

Children
No Data
Related