Hi
I can get the current time from the server using the time service characteristic. Which function should I use to set the RTC clock on the nrf 51 to the current time obtained from the server so that the timer starts from that point.
Hi
I can get the current time from the server using the time service characteristic. Which function should I use to set the RTC clock on the nrf 51 to the current time obtained from the server so that the timer starts from that point.
There is no clock on the nrf51 which has a notion of 'current time'. The RTC is just a counter. if you want to use it as a clock you have to get it to call you at regular time intervals (eg one second) and then you count ticks and turn that into a time.
So when you get the current time from the server, you set your count to that time and start counting from there.
But the COUNTER register is read only for the RTC right? Thats what I had read. Please correct me If I am wrong here
this has nothing to do with the counter register on the RTC, and it's not read only anyway, although it may be in use by something like the app_timer module. But it's really irrelevant anyway, the RTC will just give you regular ticks, you need to implement the clock functions by yourself.