I want to use a timer to track time. Like having a variable that shows minutes/seconds/ms/etc. But I don't know how to do with that.I want to use the rtc, but rtc1 had been used by app_timer and the rtc0 will be affected by Timer0,1,2.
I want to use a timer to track time. Like having a variable that shows minutes/seconds/ms/etc. But I don't know how to do with that.I want to use the rtc, but rtc1 had been used by app_timer and the rtc0 will be affected by Timer0,1,2.
I was trying a lot of solution how to do it but in result I decided to add external rtc component I'm using pcf8563 and for me this is the simplest solution.
RTC1 is used by app_timer, but you could use an app_timer to count your ticks. I have no idea what you mean by 'rtc0 will be affected by TImer 0,1,2' because RTC0 and TIMER0, TIMER1 and TIMER2 are entirely different things and they aren't affected by each other at all. However RTC0 is used by the softdevice, as is TIMER0, so you can't use either of those.
Trivially you set up an app_timer to call you on a regular basis and count ticks. Probably won't be as accurate as you want because the RTC accuracy is good enough for bluetooth, but will drift over the course of days more than you want for a good timer.
Create your own app timer that uses rtc1 and keeps running so you can keep track of the current time.
thanks,finally I use another channel of RTC1 for the base of clock ticks.
thanks,finally I use another channel of RTC1 for the base of clock ticks.