I am using nrf52832 and i want time.
I am using nrf_calendar_example https://github.com/NordicPlayground/nrf5-calendar-example.
My problem is it gives only resolution of 1 second.
may i get it as 1 millisecond?
I am using nrf52832 and i want time.
I am using nrf_calendar_example https://github.com/NordicPlayground/nrf5-calendar-example.
My problem is it gives only resolution of 1 second.
may i get it as 1 millisecond?
Hi
The nrf_calendar example is built around the time_t structure, and this structure doesn't have the accuracy to count milliseconds, only seconds.
It should be possible to store the milliseconds on the side, but it won't be a very elegant solution and will require you to make quite a lot of changes to the example.
If you change the RTC prescaler to 0 the RTC will run at 32.768kHz, which should be enough to give you millisecond accuracy, but you have to change some of the math in the driver to make sure the seconds don't run too fast ;)
Best regards
Torbjørn
Hi
The nrf_calendar example is built around the time_t structure, and this structure doesn't have the accuracy to count milliseconds, only seconds.
It should be possible to store the milliseconds on the side, but it won't be a very elegant solution and will require you to make quite a lot of changes to the example.
If you change the RTC prescaler to 0 the RTC will run at 32.768kHz, which should be enough to give you millisecond accuracy, but you have to change some of the math in the driver to make sure the seconds don't run too fast ;)
Best regards
Torbjørn