Skip to main content
pferd
Associate II
Aug 19, 2020 11:21 AM UTC
Solved

Clock recovery system CRS

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.
TDK
TDKBest answer
Aug 19, 2020 12:58 PM UTC

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""."

3 replies

TDK
TDKBest answer
Aug 19, 2020 12:58 PM UTC

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
Aug 19, 2020 6:15 PM UTC

Thank you for help !​

BChan.4
Associate
Jul 20, 2022 5:17 PM UTC

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.