2016-05-26 09:05 AM
Hello,
Looking at the RM0090, I can read on the RTC_CR register description :Bit 17 SUB1H: Subtract 1 hour (winter time change)
When this bit is set outside initialization mode, 1 hour is subtracted to the calendar time if the
current hour is not 0. This bit is always read as 0.
Setting this bit has no effect when current hour is 0.
0: No effect
1: Subtracts 1 hour to the current time. This can be used for winter time change.
Bit 16 ADD1H: Add 1 hour (summer time change)
When this bit is set outside initialization mode, 1 hour is added to the calendar time.
This bit is always read as 0.
0: No effect
1: Adds 1 hour to the current time. This can be used for summer time change
Is there some example of how to use these bits somewhere ?
Best Regards
2016-05-26 09:57 AM
Hi
IT4s configured inside RTC_TimeTypeDef Structure. Th following code is an example of how to attribute those parameters in Hal example./*##-2- Configure the Time #################################################*/
/* Set Time: 02:00:00 */
stimestructure.Hours = 0x02;
stimestructure.Minutes = 0x00;
stimestructure.Seconds = 0x00;
stimestructure.TimeFormat = RTC_HOURFORMAT12_AM;
stimestructure.DayLightSaving = RTC_DAYLIGHTSAVING_SUB1H;
// stimestructure.DayLightSaving = RTC_DAYLIGHTSAVING_ADD1H;
stimestructure.StoreOperation = RTC_STOREOPERATION_RESET;
if(HAL_RTC_SetTime(&RtcHandle,&stimestructure,RTC_FORMAT_BCD) != HAL_OK)
{
/* Initialization Error */
Error_Handler();
}
Referto''RTC-Calander'' example inside the
at this path:
STM32Cube_FW_F4_V1.0\Projects\STM324x9I_EVAL\Examples\RTC\RTC_Calendar
-Hannibal-
2016-05-27 07:03 AM
2016-05-27 07:54 AM
Hi pipon.herve.001,
So, what is ecxactly your need ? you ought to start coding by yourself . Start by making a little code example where you configure the RTC Timer and calender and set the bits and track results .. -Hannibal-