[nrf51][nrf52][S130][SDK12.3] Modify the protocol stack clock

Publisher:keiss2018Latest update time:2022-08-19 Source: csdnKeywords:nrf51  nrf52 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC;

// see nrf_sdm.h for more details

nrf_clock_lf_cfg_t clock_lf_cfg = 

{

    .source = NRF_CLOCK_LF_SRC_RC,

    .rc_ctiv = 16, // Interval in 0.25 s, 16 * 0.25 = 4 sec

    .rc_temp_ctiv = 2, // Check temperature every .rc_ctiv, but calibrate every .rc_temp_ctiv 

    .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM,

};

Internal RC Oscillator: The chip has an internal RC oscillator with an accuracy of 250ppm when calibrated. The only thing you can select for the RC via this enumeration is the calibration interval. As given in the nRF51822 PS, the accuracy is specified when the temperature is relatively stable, and it calibrates every 4 seconds, so this is the calibration interval that should be used for most (all?) applications.  


While the RC is being calibrated, the 16MHz clock must be running during the calibration process, which will cause the average current consumption to increase by 6-7μA at 4 second intervals. The RC also uses more current than the crystal, so the total increase compared to a 20 ppm crystal might be 8-10µA.  


This mode uses the enumeration: NRF_CLOCK_LFCLKSRC_RC_250_PPM_xMS_CALIBRATION, where x is the desired calibration interval, typically 4000 milliseconds.  


In recent SDKs, a calibration option with respect to temperature changes has been added, it has enum nrf_clock_lfclksrc_rc_250_ppm_temp_xms_calibration. This will have lower current consumption than the nrf_clock_lfclksrc_rc_250_ppm_xms_calibration option, because the RC is only calibrated if there is a temperature change of 0.5℃ or more. The frequency drift of the RC is actually a result of temperature changes. The internal temperature peripheral of the nRF51 is used to make temperature measurements. If there has been a temperature change of 0.5℃ or more since the last calibration, the nRF51 is recalibrated. If the temperature change is <0.5℃, then the RC is not calibrated. Calibration of the RC takes 17ms, but measuring the temperature only takes 35us, which explains why measuring the temperature consumes less current than calibrating. If there are frequent temperature changes, the current consumption increase compared to a 20ppm crystal will be a worst case 8-10 uA. If the temperature changes are not frequent, then the current consumption increase compared to a 20ppm crystal will be about ~2uA.  


A synthesized 32.768 kHz clock: This tells the softdevice to synthesize a lower frequency clock using the 16 MHz clock. Since the lower frequency clock is used during sleep, such as between connection events, this means that the 16 MHz must always be running, which greatly increases current consumption (most likely mA average current consumption, not µA).  


Generally speaking there should be no reason to use this clock source, you should always be able to use an RC oscillator instead of a synthesized clock.  


This mode uses the enumeration: NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM and should not be used.  


The clock configuration location of nrf52 is as follows

Keywords:nrf51  nrf52 Reference address:[nrf51][nrf52][S130][SDK12.3] Modify the protocol stack clock

Previous article:[nrf51][nrf52][SDK17] How to achieve low power operation in NRF series? Can it be accessed with freertos?
Next article:[bsp layer][nrf52832][nrf52840][nrf52810][nrf52820][bsp_rng] RNG random number generator configuration and use

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号