| Electronic Components Datasheet Search |
|
AN4631 Datasheet(PDF) 19 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN4631 Datasheet(HTML) 19 Page - STMicroelectronics |
|
19 / 30 page ![]() DocID027266 Rev 2 19/30 Internal RC oscillator calibration 29 2.3.4 HSI48 calibration HSI48 can calibrated the same way as HSI16 or MSI. But STM32L0 family implements CRS (Clock recovery system) that is capable of doing automatic adjustment of oscillator trimming based on comparison with a selectable synchronization signal. Internally it implements a 16-bit down/up counter which step by step increments or decrements TRIM value until it reaches expected frequency value. The HSI48 calibration using CRS can be run fully automatic. To speed up the process, the CRS can be used for measurement of the actual error, and set trim value with precalculated value. This process can repeated once or twice as the curve might not be linear. When requested frequency is reached automatic calibration can be activated for further smooth calibration, e.g. compensating temperature changes. 2.3.5 HSI16/MSI frequency measurement Internal oscillator frequency measurement is performed by Timer 21 capture interrupt. In the timer TIM21 ISR, an entire period of internal oscillator frequency is computed. The number of periods to be measured for each trimming value is configurable by the user in the hsi16.c or msi.c files as follows: #define HSI16_NUMBER_OF_LOOPS 10 /* Number of periods to be measured = 10 */ The averaging method is used to minimize frequency error measurements. So, if the counter of loops reaches NUMBER_OF_LOOPS, the average of all measured frequencies is computed. You can easily configure the frequency of the reference source. It is defined in the header file hsi16.c or msi.c as follows: • If the LSE clock is used as the reference frequency, uncomment the line below to make sure the LSE is configured and internally connected to Timer 21 channel 1: #define USE_REFERENCE_LSE • If the reference frequency is a mains source frequency equal to 50 Hz, then comment the line above and define the reference frequency as shown below: #define REFERENCE_FREQUENCY (uint32_t)50 /* The reference frequency value in Hz */ The computation of the frequency measurements does not depend on the duty cycle of the source reference signal. It depends on its frequency since the capture 1 interrupt is configured to occur on every rising edge of the reference signal (refer to Figure 5). Note: Figure 12 provides the frequency measurement algorithm. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |