2024-08-05 11:36 PM
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:
Any pointers which value to use for calibration?
Thanks,
Tim
2024-08-05 11:58 PM
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.
2024-08-06 12:06 AM
Need low bps (1200) for uart and high clock rate (100MHz) for others. cant go down to 1200 bps with 100MHz
Tim
2024-08-06 01:00 AM
But you could choose other source, here at 48M (anyway for USB needed) or LSE for 1200 baud:
2024-08-06 01:15 AM
it is uart6. Plck2 is an option. I need it to be 100MHz
Tim
2024-08-06 02:03 AM
+ and LSE :
at 1.1% max. error , much better than HSI ( 4% error ...)
Just try it !
2024-08-06 04:59 AM - edited 2024-08-06 05:00 AM
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.
2024-08-06 05:12 AM
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
2024-08-06 05:29 AM
You can put out HSI on MCO1 and check with a DSO or counter.
2024-08-06 05:31 AM
So HSI_CAL has 32 config ( five bytes - HSITRIM) table then. Thanks
Tim