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?
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?
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).
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).
OK, I will test this setting.
But, is there any possibilty to impact on the other functionalities?
Currently I am using Mesh SDK 4.0.0 for developing.
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
Ok, I see that the mesh models use the app_timer library. If you get static assert, the value you configurated is most likely not compatible with the mesh SDK. Did you try increasing APP_TIMER_CONFIG_RTC_FREQUENCY to 1 or 3?
The other alternatives are to use a second RTC for the long-running timers and configure this with a higher prescaler value, or you can run a shorter repeating app_timer and increment a variable in the handler to keep track of how long it has been running.
APP_TIMER_CONFIG_RTC_FREQUENCY with non-zero is not working, as I tried.
OK. I will try alternatives. Can you give me a link to the references that I can refer to?
I need some clarification how to be notified when RTC overflow occurs, and etc.
And, can I use secondary RTC without hardware modification?