Skip to main content
pferd
Associate II
August 19, 2020
Solved

Clock recovery system CRS

  • August 19, 2020
  • 3 replies
  • 1440 views

Hello,

I have problem with CRS (Clock recovery system) in STM32F091xx. I use HSI48 and I want to generate synchronization with LSE (32.768 kHz).

How to set FELIM in CFGR register and TRIM in CR register ?

Thank your for help.

This topic has been closed for replies.
Best answer by TDK

Set RELOAD and FELIM fields accordingly in the CRS_CFGR register.

RELOAD = (fTARGET / fSYNC) - 1

FELIM = (fTARGET / fSYNC) * STEP[%] / 100% / 2

For you, fTARGET=48MHz, fSYNC=32kHz, and STEP=0.14%.

TRIM is adjusted automatically. You don't set it manually.

3 replies

TDK
TDKBest answer
August 19, 2020

Set RELOAD and FELIM fields accordingly in the CRS_CFGR register.

RELOAD = (fTARGET / fSYNC) - 1

FELIM = (fTARGET / fSYNC) * STEP[%] / 100% / 2

For you, fTARGET=48MHz, fSYNC=32kHz, and STEP=0.14%.

TRIM is adjusted automatically. You don't set it manually.

"If you feel a post has answered your question, please click ""Accept as Solution""."
pferd
pferdAuthor
Associate II
August 19, 2020

Thank you for help !​

BChan.4
Associate
July 20, 2022

It is best to keep in mind that the intended fSYNC target is around 1kHz based on the USB SOF. This yields a FELIM of 34 which CubeMX defaults to. Using fSYNC=32768 causes FELIM to be 2 which is a very small margin and causes CRS to auto trim much more frequently than intended. I am using LSE/32 for fSYNC=1024 and FELIM of 33 based on the equations above.