2018-04-10 05:50 AM
Following is GetTime function, It always give SubSeconds from 255 to 0 in count down mode. Values read in few ms interval.
static void RTC_GetTime(void)
{
RTC_DateTypeDef sdatestructureget; RTC_TimeTypeDef stimestructureget;HAL_RTC_GetTime(&hrtc, &stimestructureget, RTC_FORMAT_BIN); HAL_RTC_GetDate(&hrtc, &sdatestructureget, RTC_FORMAT_BIN);printf('\r\n%0.2d:%0.2d:%0.2d:%0.2d', stimestructureget.Hours, stimestructureget.Minutes, stimestructureget.Seconds, stimestructureget.SubSeconds);}logs are :-
05:34:35:149
05:34:35:9905:34:35:4805:34:36:25405:34:36:20305:34:36:15305:34:36:10305:34:36:5205:34:36:0205:34:37:20805:34:37:15705:34:37:10705:34:37:5705:34:37:0605:34:38:21205:34:38:16105:34:38:11105:34:38:6105:34:38:1005:34:39:21605:34:39:16605:34:39:11505:34:39:6505:34:39:1505:34:40:22005:34:40:17005:34:40:12005:34:40:6905:34:40:1905:34:41:225Any suggestion ?
#stm32l4 #rtc2018-04-10 05:58 AM
Values read in 400 ms interval.
...
05:34:38:212
05:34:38:16105:34:38:11105:34:38:6105:34:38:105 x 400ms equals 2000ms.
There could not be more than 3 readings per second in the worst case, if that was true.
Something is wrong here ...
2018-04-10 08:14 AM
uint32_t SubSeconds; /*!< Specifies the RTC_SSR RTC Sub Second register content. This parameter corresponds to a time unit range between [0-1] Secondwith [1 Sec / SecondFraction +1] granularity */
[1 Sec / SecondFraction +1]
SecondFraction = 255
granularity =
1 Sec / (255 + 1) = 0.00390625SubSeconds = 212 read value
real value in sub second =
SubSeconds *
granularity = 0.828125 sec = 828 ms
So output values are correct only in reverse order, why its in reverse order its problem ?
2018-04-10 04:25 PM