This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Calculation of time

Hi Team,

Does it have some functions to calculate the working time from the starting point on nrf52850 chips?

Best,

Gaosheng

  • Hello,

    The MSP430FR5994 is not a Nordic Semiconductor product, so we do not provide technical support for it here in the DevZone forum.
    I would recommend that you open a ticket for this in a Texas Instrument forum instead.

    Best regards,
    Karl

  • Sorry for typing errors, I mean nrf52840 chips. 

  • 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

Related