Hi Team,
Does it have some functions to calculate the working time from the starting point on nrf52850 chips?
Best,
Gaosheng
Oh, I see - thank you for clarifying.
There is no innate function for checking time since chip startup, but you could start a timer at the beginning of your main function and read that out later to see how long time the device has been on for. This will however only capture that time that code has been executing on the chip, so it does not encompass the time it took to power up and run the code to start the timer.
What are your requirements for your timing - how accurate does it need to be, and what resolution are you looking for?
Best regards,
Karl
Hi Karl,
My requirement is to calculate the time from the starting point to the drown-out. I want to preserve the value on flash memory. Then next time, I can read from the flash memory. The resolution I think it is ms level.
Best,
Gaosheng
Hello again, Gaosheng
Aha, I see - then I suggest setting up an RTC or app_timer instance at the beginning of your main(), and then write its value to FLASH every so often. Using the RTC or app_timer instance will have a lower power consumption as well as a lower accuracy than using the TIMER peripheral for this task. Since you only need accuracy in the ms magnitude it will be totally fine to use the low power options for this.
Best regards,
Karl