cancel
Showing results for 
Search instead for 
Did you mean: 

F1 RTC prescaler

Uwe Bonnes
Principal II
Posted on January 25, 2017 at 15:54

Hello,

while rm0008 Rev. 16 18.4.3 says:

Note: If the input clock frequency (fRTCCLK) is 32.768 kHz, write 7FFFh in this register to get a

signal period of 1 second.

STM32Cube_FW_F1_V1.4.0/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc.c writes

WRITE_REG(hrtc->Instance->PRLL, 0x00008000);

What document is right?

1 ACCEPTED SOLUTION

Accepted Solutions
Nesrine M_O
Lead II
Posted on January 26, 2017 at 10:46

Hi,

The RTC PRLL register has a reset value equal to 0x8000 and the Hal RTC DeInit function is used to reset the RTC peripheral registers to their default values (restores the peripheral default state, frees the low-level resources and removes any direct dependency with the hardware).

-Nesrine-

View solution in original post

3 REPLIES 3
Oliver Beirne
Senior
Posted on January 26, 2017 at 10:00

Hello

I have moved your thread to the

https://community.st.com/community/stm32-community/stm32-forum?sr=search&searchId=cd6c772b-0ae0-4541-a5bc-41dee9d8282a&searchIndex=0

‌ where someone should be able to assist you.

Thanks

Oli

John F.
Senior
Posted on January 26, 2017 at 10:40

The ref manual also says, fTR_CLK = fRTCCLK/(PRL+1)

so it's clear that 0x7FFF is the correct value and HAL is wrong.

Nesrine M_O
Lead II
Posted on January 26, 2017 at 10:46

Hi,

The RTC PRLL register has a reset value equal to 0x8000 and the Hal RTC DeInit function is used to reset the RTC peripheral registers to their default values (restores the peripheral default state, frees the low-level resources and removes any direct dependency with the hardware).

-Nesrine-