AnsweredAssumed Answered

Millisecond granularity on RTC (STM32F4 Cube HAL Library)

Question asked by emretiryaki on Dec 16, 2015
Latest reply on Dec 22, 2015 by Clive One

I just noticed something strange using the RTC of STM32F407 with CUBE HAL Library.

When calling HAL_RTC_SetTime(); I see no register writes are performed for the SecondFraction field of the RTC_TimeTypeDef structure reference I pass as an argument.

Am I missing something? Am I not able to set the second fraction to 999. It always returns as 255.

My Cube HAL library version is 1.10.0 by the way.

Looking through the cube reference rev 3, page 666 :) (RCT_TimeTypeDef Data Fields) the Field Documentation section mentions the situation as below:

uint32_t RTC_TimeTypeDef::SecondFraction
Specifies the range or granularity of Sub Second register content corresponding to
Synchronous pre-scaler factor value (PREDIV_S) This parameter corresponds to a
time unit range between [0-1] Second with [1 Sec / SecondFraction +1] granularity.
This field will be used only by HAL_RTC_GetTime function

Well my question stands. How do I get a millisecond granularity then?

Thanks in advance for all the support.

Best Regards,