syndrom
syndrom

Reputation: 13

STM32F072 LSI Calibration

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

https://www.st.com/content/ccc/resource/technical/document/reference_manual/c2/f8/8a/f2/18/e6/43/96/DM00031936.pdf/files/DM00031936.pdf/jcr:content/translations/en.DM00031936.pdf

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 RTC Clock ?

Thanks.

Upvotes: 1

Views: 2594

Answers (2)

Craig
Craig

Reputation: 76

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, why not just use that for the RTC and disable the LSI? 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.

Upvotes: 4

Colin
Colin

Reputation: 3524

You are correct, the LSI isn't trimmable in this part, and as stated in the datasheet the typical frequency is 40 kHz, but can be anywhere between 30 and 50 kHz, it isn't a great choice for an RTC if you require any kind of accuracy.

I suppose if you can measure the difference between the LSI and LSE clocks, you could compensate for the time offset in the RTC when you know whether you're running fast or slow, but that will be very temperature dependant.

Upvotes: 0

Related Questions