Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- STMicroelectronics Community
- STM32 MCUs
- STM32 MCUs products
- Confirmation about RTC input Clock Frequency when ...

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

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

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

2024-02-06 08:39 PM - edited 2024-02-06 08:40 PM

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.

Thank you!

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

2024-02-07 12:44 AM

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.

2 REPLIES 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

2024-02-07 12:44 AM

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

2024-02-11 07:05 AM

Thank you @Danish1,

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

Related Content

- PWM one-shot mode stops working after exactly 427 pulses in STM32 MCUs products
- STM32H7 QUADSPI clock configuration in STM32 MCUs products
- STM32U599 DAC doesn't work in DMA mode. in STM32 MCUs products
- Sensorless FOC speed feedback error and extremely poor starting torque in STM32 MCUs Motor control
- Compiling error when using CMSIS-DSP: conflicting types for 'clip_q63_to_q31'; have 'q31_t(q63_t)' { in STM32 MCUs Embedded software