Hi all,
I'am sending epoch time from nrf_connect(mobile) to nrf52840dk only once,
then i need to update epoch time continuosly with nanosecond frequency
how can i do it
Regards
Tushar
Hi all,
I'am sending epoch time from nrf_connect(mobile) to nrf52840dk only once,
then i need to update epoch time continuosly with nanosecond frequency
how can i do it
Regards
Tushar
Hi Einar Thorsrud,
timeutil_timegm() and timeutil_timegm64() converts human readable to epoch time but i am passing value from mobile to nrf52840dk is epoch value, so i want an api which gives me epoch value of the current timezone
Regards
Tushar
Hi Tushar,
That is up to you. The only thing you get from the SDK is time as ticks of a counter of some sort (there are many different options here, but it all comes down to the same), and you must relate that to the real time you got from the phone.
Hi Einar Thorsrud,
I am using k_uptime_get() which is giving me values in millisecond in nrf_connect_sdk zephyr
is there any api which gives microsecond
Regards
Tushar
Hi Tushar,
There is no timer with that resolution in Zephyr (you could get CPU cycles, but that will most likely not work as I assume you don't intend to let the CPU run always, wasting power(?)).
Moreover, there is no low power clock source that will give you that resolution, so if you want that you will have to use a TIMER peripheral. You would need to handle wrap arounds though (perhaps simplest by using a 64 bit offset that you update whenever it wraps around), and normally when you read the time take the current timer value + the accumulated offset (+ whatever you got from syncing with the phone).
Note that this can never be low power, and there is physically no way to get better resolution than maximum 32.768 kHz with low power, as that is the frequency of the low power oscillator on the hardware. If you need low power (this is a key question!), then the only option to also give you better time resolution is to use an external RTC that can give a compromise between resolution, accuracy and power consumption that fits you requirements.
Hi Einar Thorsrud,
In RTC which api can i use to get the value in microsecond
can u please tell me
Regards
Tushar