STM32 MSI (MSIK) PLL Mode/Auto Calibration: Frequency Error
I have a STM32U595 with a 32.768kHz LSE oscillator.
I wish to generate a 1ms/1kHz timebase with the accuracy/drift characteristics of the LSE, so naturally I went to make use of the "Hardware auto calibration with LSE (PLL-mode)" feature.
Firstly, can I say that there is generally nowhere near enough detail for this feature in the STM32U5 documentation, which is probably a contributing factor to my issue. The L4 series has some random powerpoint presentations which shed a bit more light, but that's assuming this feature works the same in the U5 series.
When I turn on MSI PLL-Mode, MSIK does not appear to lock to actual frequency specified. When I compare RTC calibration to MSIK fed to MCO on a 'scope MSIK does appear to phase lock in terms of drift. However, whereas the RTC calibration output is very very close to 1Hz, the MSIK frequency is actually worse then without the PLL-mode.
To rule out the 'scope, I used my (supposedly) PLL'd MSIK as the kernel clock for a LPTIM (to avoid clock synchronising) and generated a 1Hz PWM signal. When I do this, the RTC generated 1Hz and MSIK derived 1Hz are not the same, and can be seen to drift past each other.
I sincerely hope it isn't the case, but is it possible that a "100kHz" MSIK is in fact 98.304kHz (ie 3 x 32.768kHz) when PLL-mode is turned on? That would be very disappointing.
Could I have more (some) details regarding exactly how "PLL-Mode" works?
Edit:
I (think I) have confirmed this: If I assume the "100kHz" clock from MSIK is in fact 32.768kHz x3 = 98.204kHz, and set the timer period accordingly (to 98303 instead of 99999) to generate a 1Hz signal, I see complete phase/frequency lock between the RTC 1Hz, the MSIK MCO output and my timer generated 1Hz.
ST, I should not have to tell you this, but 100 != 98.304.
