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

Using RTC to get real time for nRF9160DK

Hi Dev team,

I had an issue regarding getting the real time using RTC. I tried to follow the below dev zone blog but the CAL_RTC does not work in my code.

As such, I am unable to use this to build my application. Does nR9160DK not support "CAL_RTC" like "NRF_CLOCK" .

Can you let me know how I could use the below code to build my app for nRF9160DK.

https://devzone.nordicsemi.com/f/nordic-q-a/51781/rtc-31st-date-problem-in-nrf52840

Also, a question regarding RTC and LFCLK. How can I view the real time value using RTC and LFCLK.

I can see in the debugger that they are running but I need to know the real time through it. Some help in explaining this would be appreciated :).

Regards,

Adeel.

Parents Reply
  • Hi Tobjorn,

    Continuing my previous question, I had an issue regarding setting the RTC compare value for periodic compare events. 

    https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/nrfx/rtc

    I used the following example and was building on it. Its working fine for 1 compare event but I wish to have periodic compare events at my scheduled times.

    To do that, I am trying to update the compare value by adding it to the counter value in the rtc_handler() part of the code as soon as I get my 1st compare event.

    The ideas was this: NEW_COMPARE_VALUE = CURRENT_COUNTER_VALUE + PREVIOUS_COMPARE_VALUE;

    For some reason, the compare value does not update and I don't get the next compare event. Could you help me with the code structure that updates the compare value of the counter for periodic events.

    Regards,

    Adeel.

Children
Related