cancel
Showing results for 
Search instead for 
Did you mean: 

Confirmation about RTC input Clock Frequency when using HSE as clock source

Chubs
Senior

Hello Community,

We are selecting a high stability 12.288MHz HSE to clock our RTC on STM32G0 series MCUs.

Kindly suggest if the HSE/32 which is 384kHz would be able to operate the RTC? I did not find any mentions of the maximum clock frequency for the RTC on STM32 MCUs. I understand the RTC has a prescaler, kindly direct me to the correct configurations.

Clock Tree configuration using HSE with 12.288Mhz as clock input for the RTC on STM32G0Clock Tree configuration using HSE with 12.288Mhz as clock input for the RTC on STM32G0

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Danish1
Lead II

The key document for this is the Reference Manual for your stm32.

Looking at the Reference Manual RM0444 for STM32G0x1, in section 30 "Real Time Clock" I can see that your 384 kHz would go through an asynchronous prescaler (default value 128) followed by a synchronous prescaler (default value 256), the product of those two being used to generate a 1 Hz clock from the default 32768 Hz.

So the question is can you reconfigure those prescalers to get 1 Hz from 384 kHz?

RTC_PRER has 7 bits of PREDIV_A (so max value 127) and 15 bits of PREDIV_S (so max value 32767)

And you are after 1 Hz when dividing 384000 by (PREDIV_A+1)*(PREDIV_S+1)

For lowest power, you want PREDIV_A as high as possible, so let's put it at 127.

So PREDIV_S would need to be (384000/(127+1)) - 1, which I make as 2999

This easily fits into 15 bits. So yes it can be done.

 

View solution in original post

2 REPLIES 2
Danish1
Lead II

The key document for this is the Reference Manual for your stm32.

Looking at the Reference Manual RM0444 for STM32G0x1, in section 30 "Real Time Clock" I can see that your 384 kHz would go through an asynchronous prescaler (default value 128) followed by a synchronous prescaler (default value 256), the product of those two being used to generate a 1 Hz clock from the default 32768 Hz.

So the question is can you reconfigure those prescalers to get 1 Hz from 384 kHz?

RTC_PRER has 7 bits of PREDIV_A (so max value 127) and 15 bits of PREDIV_S (so max value 32767)

And you are after 1 Hz when dividing 384000 by (PREDIV_A+1)*(PREDIV_S+1)

For lowest power, you want PREDIV_A as high as possible, so let's put it at 127.

So PREDIV_S would need to be (384000/(127+1)) - 1, which I make as 2999

This easily fits into 15 bits. So yes it can be done.

 

Thank you @Danish1,

This was a clear & precisely written solution for the query.