51822蓝牙笔记之时钟和功耗的关系
来源:互联网 发布:数据库表之间的关系图 编辑:程序博客网 时间:2024/06/13 02:10
The softdevice needs a low-frequency clock to be able to do the protocol timing. With this enum, you tell the softdevice what kind of clock source you use, and the accuracy of it. In general you have 3 options for this source://有三个时钟源可以选择
- 1、外部晶振:External crystal: Using an external 32.768 kHz crystal is the option that gives the lowest current consumption(提供最低功耗). If you have this on your board, you should use it. You have to choose the appropriate accuracy for your crystal, so that the softdevice can take the accuracy into consideration to know how much the clock may drift over a certain period. It will use this information to make sure it compensates correctly and wakes up the chip just when needed.
Enums used for this mode with softdevice: NRF_CLOCK_LFCLKSRC_XTAL_x_PPM, where x is the accuracy of your crystal.
When not using softdevice, external 32kHz crystal is started with the following code:
When not using a softdevice, starting external 32kHz crystal is done with the following code:
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos); NRF_CLOCK->EVENTS_LFCLKSTARTED = 0; NRF_CLOCK->TASKS_LFCLKSTART = 1; // Wait for the low frequency clock to start while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0) {} NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
- 2、内部RC振荡器 :Internal RC oscillator: The chip have an internal RC oscillator that has an accuracy of 250 ppm when calibrated. The only thing you can choose through this enum for the RC is the calibration interval. As given in the nRF51822 PS, the accuracy is specified when the temperature is relatively stable, and it iscalibrated every 4 seconds(每四秒校准一次), so this is the calibration interval that should be used for most (all?) applications.
When the RC is calibrated, the 16 MHz clock must run while calibration is ongoing, which causes an increase in the average current consumption of about 6-7 µA with a 4 s interval. The RC also uses more current than a crystal, so the total increase will most likely be 8-10 µA, compared with a 20 ppm crystal.
Enums used for this mode: NRF_CLOCK_LFCLKSRC_RC_250_PPM_xMS_CALIBRATION, where x is the wanted calibration interval, typically 4000 ms.
In recent SDK's, there has been added options with calibration relative to temperature change which has the enum NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_xMS_CALIBRATION. This will have lower current consumption than NRF_CLOCK_LFCLKSRC_RC_250_PPM_xMS_CALIBRATION options as the RC is only calibrated if there is a temperature change of 0.5 deg C or more. The frequency drift of the RC is in fact a result of temperature change. The internal TEMP peripheral on the nRF51 is used to make a temperature measurement. If there is a temperature change of 0.5 deg C or greater since the last calibration, then the nRF51 is re-calibrated. If the temperature change is <0.5 deg C, then the RC is not calibrated. The calibration of the RC takes 17ms but measuring the temperature only takes 35us, which explains why measuring the temperature consumes less current then when calibrating.If there are frequent temperature changes, the current consumption increase will be worst case 8-10 uA compared to a 20ppm crystal. If there are infrequent temperature changes, then the current consumption increase is around ~2uA best case compared to a 20ppm crystal.(当温度改变的时候,选择校准精度20ppm,功耗会浪费最低2ua 最高10ua)
- 3、由16M高速时钟分频合成:A synthesized 32.768 kHz clock: This tells the softdevice to use the 16 MHz clock to synthesize a low-frequency clock. Since the low-frequency clock is used in the sleeping periods between for example conneciton evetns,this means that the 16 MHz must always run, giving a substantial increase in current consumption (most likely mA average current consumption instead of µA)(使用合成意味着16M高速运行,将增加功耗从uA到mA). In general, there should never be a reason to use this clock source, and you should always be able to use the RC oscilator instead of the synthesized clock.
- 51822蓝牙笔记之时钟和功耗的关系
- 学习笔记之低功耗蓝牙开发
- 关于经典蓝牙和低功耗蓝牙的区别
- 低功耗蓝牙cc2541学习笔记之LED-1
- 低功耗蓝牙cc2541学习笔记之LED-2
- 低功耗蓝牙cc2541学习笔记之协议栈简介
- 低功耗蓝牙(学习笔记)
- 低功耗蓝牙BLE以及iBeacon的开发笔记
- Android之低功耗蓝牙的基本使用
- Android之低功耗蓝牙的基本使用
- 蓝牙学习之旅——低功耗蓝牙之频带和通道
- 全球最低功耗蓝牙单芯片DA14580的硬件架构和低功耗
- 低功耗蓝牙的基础
- [BLE]低功耗蓝牙之GAP、GATT
- 低功耗蓝牙BLE之报文
- 低功耗蓝牙BLE之广播
- 低功耗蓝牙BLE之连接建立
- 低功耗蓝牙BLE之报文
- 张洋:浅析PageRank算法
- Java--对象增强的手段
- 【Java基础】——集合
- 【Java学习笔记】——Filter
- java.lang.NoSuchFieldException: DEFAULT_PARAM
- 51822蓝牙笔记之时钟和功耗的关系
- Android自定义组合控件
- 1002. 写出这个数 (20)
- Java基础编程机试题
- Sublime Text 3 配置
- Web存储机制
- Windows 7 x64 MSDN版 安装完毕自动更新一直子检查更新问题解决方法
- Codevs 1269 匈牙利游戏 2012年CCC加拿大高中生信息学奥赛
- 异常