stm32cpu-registers

STM32F072 LSI calibration


I recently started with embedded programming and currently I'm tasked with LSI calibration based on the LSE clock. This would be useful when the device enters low-power mode. Based on this reference manual:

RM0091. Reference manual. STM32F0x1/STM32F0x2/STM32F0x8 advanced ARM-based 32-bit microcontrollers

I don't see any registers for LSI calibration, like the ones HSICAL, HSI14CAL...

Does this mean the calibration for LSI is not achievable before using it as an RTC clock?


Solution

  • If you're driving the RTC fom the LSI, you can adjust the sync_prediv and async_prediv values to make the RTC tick at the correct rate. You can work these out from measuring the actual rate of the LSI against the LSE (or HSI, or HSE). This document (especially section 4) might be helpful: Calibrating STM32F0x1, STM32F0x2 and STM32F0x8 lines internal RC oscillators

    If you have an LSE, just use that for the RTC and disable the LSI. The power consumption in low power modes will be similar with either source, and if you can use the LSE with "low-drive" power, consumption with the LSE will actually be slightly lower than LSI.