cancel
Showing results for 
Search instead for 
Did you mean: 

SMT32F767 HSI Clock Calibration

TKana.1
Associate III

Hi,

I am having uart baudrate problems while HSI clock as uart source clock. No problem with PCLK as source with the same uart.

 

In Cube IDE (V1.16.0) and F7 software package (V.17.2), I get different values for HSI_CALIBRATION:

Ide gets as 0x10 while register (RCC_CR) has 0x68 as HSI_CALIBRATION. The register also has 0x10 for HSI Trim value, which made me confused:

 

TKana1_0-1722926090116.png

Any pointers which value to use for calibration?

Thanks,

Tim

 

 

12 REPLIES 12
AScha.3
Chief II

Hi,

why you want use HSI , if you anyway have HSE -> PLL ... ?

HSI is not suitable for anything that needs a constant clock like CAN, UART, USB... .

So better use clock HSE /PLL to avoid timing problems.

 

 

If you feel a post has answered your question, please click "Accept as Solution".

Need low bps (1200) for uart and high clock rate (100MHz) for others. cant go down to 1200 bps with 100MHz

Tim

But you could choose other source, here at 48M (anyway for USB needed) or LSE for 1200 baud:

AScha3_0-1722931201085.png

 

If you feel a post has answered your question, please click "Accept as Solution".

it is uart6. Plck2 is an option. I need it to be 100MHz

Tim

 

+ and LSE :

AScha3_0-1722934854664.pngAScha3_1-1722934893273.png

at 1.1% max. error , much better than HSI ( 4% error ...)

 

Just try it !

If you feel a post has answered your question, please click "Accept as Solution".
TDK
Guru

HSITRIM = 0x10 is the default value, and is as expected. No issues there.

HSICAL gets initialized at startup using calibration values loaded during production.

 

If you want to trim the HSI, HSITRIM is the register to change. HSICAL is read-only.

 

TDK_0-1722945515806.png

 

If you feel a post has answered your question, please click "Accept as Solution".

That is a neat idea. Thank you.

Still don't understand how HSI_TRIM and HSI_CAL works. Changing TRIM effects CAL also. isn't it supposed to " After reset, the factory calibration value is loaded in the HSICAL[7:0] bits in the RCC clock control register (RCC_CR). " it is read only, too.

Is there an easy way to measure HSI with HSE based clocks? 

I see two ways: Enable MCO1 output with HSE selected and measure with a timer that sourced from HSE or produce output with a timer clocked by HSI and measure with another one clocked by HSE

 

Tim

 

You can put out HSI on MCO1 and check with a DSO or counter.

 

AScha3_0-1722947286100.png

 

If you feel a post has answered your question, please click "Accept as Solution".
TKana.1
Associate III

So HSI_CAL has 32 config ( five bytes  - HSITRIM) table then. Thanks

Tim