2018-05-14 10:40 AM
Hi,
I would like to set the milliseconds in the STM32 RTC, the function hal_rtc_settime doesn't change the milliseconds (subseconds) value.
I tried be setting hrtc->instance->rtc_ssr but it doesnt change its value
Help would be appritiated
Thank you
Solved! Go to Solution.
2018-05-14 01:07 PM
You can't. The subsecond register is read-only.
You can use the 'shift' feature, though, to manipulate the subsecond register.
Read the RTC chapter in the reference manual (RM), focus on RTC synchronization chapter and description of the RTC_SHIFTR register.
JW
2018-05-14 11:08 AM
Which STM32, there are a few, and the designs of the RTC are different on several families?
2018-05-14 01:07 PM
You can't. The subsecond register is read-only.
You can use the 'shift' feature, though, to manipulate the subsecond register.
Read the RTC chapter in the reference manual (RM), focus on RTC synchronization chapter and description of the RTC_SHIFTR register.
JW
2018-05-14 01:21 PM
My bad, STM32L452
2018-05-14 02:16 PM
It may help every once in a while to read the datasheet to see how the device you are trying to click-and-program works.
2018-05-15 01:30 AM
Thank you, I didn't noticed that it was read only
2018-05-15 01:31 AM
I have read the datasheet, I have missed the 'r' letter in the register
2018-06-05 03:12 AM
Hello,
I'm trying to set the milliseconds with STM32 H753-Eval board.
If I want to set the 400 millisenconds value(for example), should I set the 0x190(=400 decimal) into SUBFS field in RTC_SHIFTR and set the 0x3E7(= 999 decimal) into PREDIV_S field in RTC_PRER ?
Is my understanding correct ?
2018-06-07 02:09 AM