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

Set RTC in nRF52832

My application is built using the nRF52832 device. The system must only be "active" between certain times (5am through to 9pm).

I am a newbie and have no idea how to set the RTC of the nRF52832. I could either set the time in a text string OR set the time of the PC in the nRF52832 when the program is uploaded.

I use the following code snipped to check if the time is within 5am and 9pm:

case BATTERY_CHECK:

        date_time_get_current_time(&current_time);
        if(current_time.hours > 4 && current_time.hours <10)
        {

I need to be able to set the following: date_time_set_timestamp() RTC2_date_time_clock_init_N_start()

Parents Reply
  • Well, I think what Sigurd was trying to say in not so many words is that the RTC peripheral you see on the nRF52 is a real time counter, not a real time clock/calendar. You can use it to keep track of ticks at almost any interval you want, but you have to build the logic on top of it if you want to use it as a clock/calendar. The example he is pointing you to is a way to do that.

Children
No Data
Related