Get current time on RT1170-EVK

cancel
Showing results for 
Search instead for 
Did you mean: 

Get current time on RT1170-EVK

Jump to solution
218 Views
D_Tram23
Contributor IV

Good day

I would like to get the current time since the standard Epoch (00:00 01-01-1970) on my RT1170-EVK.

In other words, I want to have the functionality of the time() function from time.h on my board.

This function just returns zero, so I tried other avenues (like the SNVS_HP & SNVS_LP drivers), but nothing could give me the CURRENT time from the Real-Time Clock.

With the SNVS drivers, I can only set a time and calculate differences in time.

Kind regards

0 Kudos
1 Solution
217 Views
D_Tram23
Contributor IV

For any other newbies with a similar question:

I realised the solution is to just set the time to the current time using the SNVS_HP/LP driver, as in the example evkmimxrt1170_snvs_lp_srtc_cm4.

As long as the processor is powered, this will give you the 'current' time.

Most final implementations have a small battery to power the LP registers to keep the RTC value ticking.

Kind regards

View solution in original post

0 Kudos
1 Reply
218 Views
D_Tram23
Contributor IV

For any other newbies with a similar question:

I realised the solution is to just set the time to the current time using the SNVS_HP/LP driver, as in the example evkmimxrt1170_snvs_lp_srtc_cm4.

As long as the processor is powered, this will give you the 'current' time.

Most final implementations have a small battery to power the LP registers to keep the RTC value ticking.

Kind regards

View solution in original post

0 Kudos