nRF51822库函数速查
NRF51822 Eval Kit 用户手册说明书
Waveshare
1.1 PC development environment deployments
WindowsXP or Windows 7 nRFgo Studio v1.14 or higher versions Keil MDK-ARM Lite v4.54 or higher versions J-Link Software v4.52b or higher versions
Multi-protocol 2.4GHz radio 32-bit ARM Cortex M0 processor 128-bit AES co-processor 256kB flash / 32kB RAM Programmable Peripheral
Interconnect – PPI Full set of digital interfaces including:
2. Program descriptions ..............................................................................................4 2.1 SDK ..............................................................................................................4 2.2 Example application download explanations ..............................................4 2.3 How to download and conpile blinky_example ...........................................4 2.4 How to download and compile ble_app_hrs ...............................................7 2.5 Functional descriptions of example programs ............................................8
nRF51822 模块 规格说明书
OHTCOMTechnology Ltd.nRF51822模块规格说明书Datasheet of nRF51822 Modules2015.6.1目录1 简介 Introduction (3)2 nRF51822 M0 BLE模块介绍 specification for M0 Module . 4天线的连接 (7)程序的烧录 (8)表一 nRF51822 M0工作参数 (8)3 nRF51822 M1 BLE模块介绍 specification for M1 Module . 9程序的烧录 (11)表二 nRF51822 M1工作参数 (11)4 History (13)5 联系方式CONTACT US (14)NOTES:If you are customers from overseas, please contact sales@ for quotation and specifications of English version.1 简介IntroductionnRF51822 Mx BLE低功耗蓝牙模块目前包括nRF51822 M0、nRF51822 M1两款。
这两款BLE模块都是以nRF51822为主控芯片,封装不同的模块。
nRF51822 M0模块包含了LIS3DH3轴传感器,与百度手环使用相同的基础硬件,可以用来开发运动手环等穿戴设备。
nRF51822 M1模块单有一片nRF51822芯片,可以选择16kB RAM或者32kB RAM的不同版本,可以用来开发iBeacon、室内定位、穿戴设备,计算机控制等,应用更灵活,满足不同需求。
nRF51822 M0nRF51822 M12 nRF51822 M0 BLE模块介绍specification for M0 ModulenRF51822 M0采用BGA的nRF51822芯片封装并且集成了高低速晶振、LIS3DH三轴传感器,模块尺寸仅为10.5mm*8.5mm*1.5mm,为业界最小封装。
nRF51822上手指南
OHTCOMTechnology Ltd.nRF51822 Application KitnRF51822User Guide v0.9Copyright © 2013 Ohtcom Technology. All rights reserved.1 介绍nRF51822 Bluetooth® low energy/2.4 GHz Application Kit (AK) 提供了一整套的测试和应用nRF51822的解决方案。
nRF51822是nRF51 系列中的一员,它是一个超低功耗(ultra-low power),单片系统 (SoC) 的2.4 GHz 无线通信解决方案.1.1 最小系统要求• nRFgo Studio v1.14 或更高版本• Windows XP or Windows 71.2 外部资源• Keil MDK-ARM Lite v4.54或更高版本https:///demo/eval/arm.htm• J-Link Software v4.52b或更高版本/jlink-software.html1.3 Writing conventions这篇用户指南遵从了一些排版规则,这样能够使文章更加连贯,更加易于阅读。
以下是使用到的协作约定::• 命令使用Lucida Console.• 芯片管脚使用Consolas.• 文件名和用户接口使用bold.• 内部关联采用斜体并使用semi-bold.1.4 Application kit 发布说明Date Kit version Description2013年8月10日0.1Init.2013年8月19日0.2 加入蓝牙测试部分2013年8月25日0.3整合USB Dongle介绍.2013年8月26日0.31 确认使用USB Dongle下载可以解决Jlink不兼容的问题。
2013年8月28日0.4 完成度50%,增加200%的内容。
nRF51822外部中断学习总结
最近要用nRF51822进行项目的多任务调度,其中不可避免的要用到要用到nRF51822的相关中断首先,nRF51822是基于Cortex-M0架构的MCU,根据nRF51822的软件开发包中的core-m0.h文件夹,可以找到51822的相关中断编号定义(Interrupt Number Definition)[objc]view plain copy1.<span style="font-size:18px;">/* ------------------------- Interrupt Number Definition ------------------------ */2.3.typedef enum {4./* ------------------- Cortex-M0 Processor Exceptions Numbers ------------------- */5. Reset_IRQn = -15, /*!< 1 Reset Vector, invoked on Powerup and warm reset */6. NonMaskableInt_IRQn = -14, /*!< 2 Non maskable Interrupt, cannot be stopped or preempted */7. HardFault_IRQn = -13, /*!< 3 Hard Fault, all classes of Fault*/8. SVCall_IRQn = -5, /*!< 11 System Service Call via SVC instruction */9. DebugMonitor_IRQn = -4, /*!< 12 Debug Monitor*/10. PendSV_IRQn = -2, /*!< 14 Pendable request for system service */11. SysTick_IRQn = -1, /*!< 15 System Tick Timer*/12./* ---------------------- nRF51 Specific Interrupt Numbers ---------------------- */13. POWER_CLOCK_IRQn = 0, /*!< 0 POWER_CLOCK*/14. RADIO_IRQn = 1, /*!< 1 RADIO*/15. UART0_IRQn = 2, /*!< 2 UART0*/16. SPI0_TWI0_IRQn = 3, /*!< 3 SPI0_TWI0*/17. SPI1_TWI1_IRQn = 4, /*!< 4 SPI1_TWI1*/18. GPIOTE_IRQn = 6, /*!< 6 GPIOTE*/19. ADC_IRQn = 7, /*!< 7 ADC*/20. TIMER0_IRQn = 8, /*!< 8 TIMER0*/21. TIMER1_IRQn = 9, /*!< 9 TIMER1*/22. TIMER2_IRQn = 10, /*!< 10 TIMER2*/23. RTC0_IRQn = 11, /*!< 11 RTC0*/24. TEMP_IRQn = 12, /*!< 12 TEMP*/25. RNG_IRQn = 13, /*!< 13 RNG*/26. ECB_IRQn = 14, /*!< 14 ECB*/27. CCM_AAR_IRQn = 15, /*!< 15 CCM_AAR*/28. WDT_IRQn = 16, /*!< 16 WDT*/29. RTC1_IRQn = 17, /*!< 17 RTC1*/30. QDEC_IRQn = 18, /*!< 18 QDEC*/31. LPCOMP_COMP_IRQn = 19, /*!< 19 LPCOMP_COMP*/32. SWI0_IRQn = 20, /*!< 20 SWI0*/33. SWI1_IRQn = 21, /*!< 21 SWI1*/34. SWI2_IRQn = 22, /*!< 22 SWI2*/35. SWI3_IRQn = 23, /*!< 23 SWI3*/36. SWI4_IRQn = 24, /*!< 24 SWI4*/37. SWI5_IRQn = 25 /*!< 25 SWI5*/38.} IRQn_Type;39.</span>在进行中断处理时,一般都要按照这个步骤:1、对要用到的中断初始化;2、对用到的中断进行使能;3、对中断进行优先级设置1、中断初始化nRF51822的外部I/O(暂时理解的程度以及用过的中断只有I/O中断,其他中断没有实践过)中断是基于任务和事件模式的。
NORDIC蓝牙芯片NRF51822说明-文档资料
四、蓝牙协议和应用代码相互分开
1:NRF51822蓝牙协议和应用代码的存储空 间相互分开,互不干扰,客户只需关注
应用代码
应用代码开发,不需花大量的时间去了解蓝 176K
牙协议是如何运行的,只需配置API参数就
可运行起来。
2:TI和CSR都是只提供蓝牙源代码,客户 蓝牙协议
只能在此代码上进行修改、编译程序,把 80K 应用代码和协议混合放在同一空间里,给修
灵敏度
-94dBm -85dBm -82dBm
51822
ARM M0 256/128K ROM 16k RAM
4dBM 0dBM -4dBM -8dBM -12dBM -16dBM -20dBm
LDO 16/4dB 10.5/0dB
RX 13
DC/DC 10.5/4dB 8.1/0dB
RX 9.5
250Kbps 1Mbps 2Mbps
■ CSR:自有16位MCU,需外挂Flash/EEPROM, 无法对产品进行加密,同时增加了相应的成本和 PCB板面积。
9
二、新增功能
■电源管理:除system ON/OFF外,各功能 模块有自己的电源管理,电源管理简单,只 有ON/OFF,有利于降低功耗。
■具有DC/DC 功能: 2.1~3.6V,DC/DC功 能可以让功耗更低。
2
nRF51822功耗/灵敏度
3
nRF51822原装开发系统
原装开发系统包括2部分 1:nRFGo Starter Kit Development Kit (简称nRF6700) 包括2个开发母板,开发调试环境,支持Keil C
2:nRF51822 Development Kit (简称nRF51822-DK) 1个nRF51822 USB dongle接收端 1个nRF51822 PCB模块 1个nRF51822 SMA模块 2个J-Link开发板(烧录、仿真) 5片nRF51822样片
nrf51822数据手册_引脚图_参数
RoHS and REACH statement
Nordic Semiconductor's products meet the requirements of Directive 2002/95/EC of the European
My Page account on our home page.
Main office: Otto Nielsens veg 12
7052 Trondheim Norway
Phone: +47 72 89 89 00 Fax: +47 72 89 89 89
Mailing address: Nordic Semiconductor
Version 3.3
Description
Added documentation for the nRF51822 CTAA version of the chip.
Added content: • Section 9.5 “CTAA WLCSP package” on page 71 • Section 11.9 “CTAA WLCSP package” on page 118
statement can be found on our website
.
Page 2
nRF51822 Product Specification v3.3
Datasheet Status
Status Objective Product Specification (OPS) Preliminary Product Specification (PPS)
• ARM® Cortex™-M0 32 bit processor • 275 μA/MHz running from flash memory • 150 μA/MHz running from RAM • Serial Wire Debug (SWD)
NRF51422和NRF51822产品介绍(极低功耗蓝牙4.0)解读
2:CSR
3:美国博通
一、 MCU
■51822:32位ARM-M0, 256K(Flash)+16K(RAM),用ARM的客户群体非 常多,开发资源也非常丰富。 ■ TI:8位8051内核,决定了在性能上不能很好满足 蓝牙协议的运行,且功耗较高。 ■ CSR:自有16位MCU,需外挂Flash/EEPROM, 无法对产品进行加密,同时增加了相应的成本和 PCB板面积。
nRF51422-ARM Cortex M0
nRF51422:基于ANT和非标(如LE1)标准之间
nRF51422原装开发系统
原装开发系统包括2部分 1:nRFGo Starter Kit Development Kit (简称nRF6700) 包括2个开发母板,开发调试环境,支持Keil C
2:nRF51422 Development Kit (简称nRF51422-DK) 1个 ANT USB dongle接收端 1个nRF51422 PCB模块 1个nRF51422 SMA模块 1个J-Link开发板(烧录、仿真) 5片nRF51422样片
四、蓝牙协议和应用代码相互分开
1:NRF51822蓝牙协议和应用代码的存储空 应用代码 间相互分开,互不干扰,客户只需关注 应用代码开发,不需花大量的时间去了解蓝 176K 牙协议是如何运行的,只需配置API参数就 可运行起来。 蓝牙协议 2:TI和CSR都是只提供蓝牙源代码,客户 只能在此代码上进行修改、编译程序,把 80K 应用代码和协议混合放在同一空间里,给修 改和查找问题带来很大的困难,当产品出现 问题的时候很难判断是应用代码还是蓝牙协议的问题。
nRF51822-DK
nRF51822和nRF24LE1对比
BLE-NRF51822教程3-sdk程序框架剖析
BLE-NRF51822教程3-sdk程序框架剖析【IT168 技术】本讲为框架介绍,不会牵涉到太多代码细节。
51822的官方SDK其实是没有框架依耐性的。
什么叫框架,比如TI的BLE SDK中就有一个操作系统抽象层(OSAL)他是一个轮训的调度。
你需要按照他的方式去创建任务等等。
而51822的SDK本质上只是提供了各种调用接口,比如开启初始化协议栈,初始化一些硬件功能模块,开始广播,发起链接等等。
这些接口怎么用完全取决于自己。
不过一般固件开发都是一些类似的流程各种资源的初始化,51822也不例外。
所以sdk中的作为从机的例子main函数都是类似如下的步骤:以官方的串口BLE 为例:int main(void){leds_init(); //非必须,只是该例子中用到了timers_init(); //非必须,只是该例子中用到了buttons_init(); //非必须,只是该例子中用到了uart_init(); //非必须,只是该例子中用到了串口ble_stack_init(); //必须gap_params_init(); //必须services_init(); //跟自己创建的服务相关,不同的服务细节不同但大体建立//过程基本一致,通常在直接使用官方的例子修改一些参数即可advertising_init(); //广播数据初始化,必须conn_params_init(); //是情况而定,如果连接后不需要连接参数的协商,该初始化也//可不要sec_params_init(); //安全参数初始化,如果没用到配对绑定相关这个也可以不初始化advertising_start(); //开启广播,必须// Enter main loopfor (;;){power_manage(); //进入睡眠}}可以看到其实核心必要的只有这5个函数而已。
你可以将其他代码全都去掉,只要留下这5个函数设备一样可以运行,手机也能搜到设备并与设备通信。
我的nrf51822学习笔记
6月14日开发环境的搭建:/view/a9ce127908a1284ac85043dd.html前几天学习了nrf51822芯片详解/link?url=NoIPFYcVFVQiqtgcTIVDbTFKJsfSY0MnBKiQzptXa8Cirghc3ZCx2S TEduYpEMztfAdoMTN08Xf2pFZpAyJbYF_MV7NqPxyWwA1qFPkKOoW以前已将SDK,J-Link安装好。
今天开始学习nRF51822 在MDK中创建新工程/link?url=BGtmdmEEJg3lzoEFq7HB3LBTbZn2L9fD7rGiwBPYQkbR-gEQuw ScXm5L-DIMHjifN2FNsRgbQJv9uaT03cp2AnJZUbLm5htwoIbJLu8tdv7遇到如下问题:1、注:首先选择Nordic nRF51 Series Devices才能开始选择芯片类型(安装SDK才能有)。
我买的芯片上面显示nrf51822QFACA1,该选择AA还是AB?网上搜得AA与AB的区别为只是flash与运行代码大小的区别。
淘宝介绍说该芯片为256Kbflash,所以应该是QFAA。
6月15日关于JLINK用SWD模式与nrf51822的连接。
我连接的是GND(随便哪个地),VCC(pin1),TMS(pin7),TCK(pin9). 网上说可能还得接pin15的复位脚,但是我暂时没接。
接下来就是讲程序烧录看行不行。
1、有个问题,网上找的那个创建工程中并没有用户自己的文件(即像stm32中创建的时候会建立mai.c)不是很明白。
编译能通过,但是load的时候出现问题。
2、Load时出现如下错误:但是reset菜单没找到在哪里?又出现新问题:解决方法:第一次的时候没有遇到这个问题,所以可能是连线没接好,而且后来的jlink总感觉绿灯是闪亮的,很有可能是连线问题。
网上的答案:1.确保接线正确;2. 高版本jlink固件可识别出赝品jlink,而MDK5.x版本要求SEGGER固件高于V4.78,排查是否是盗版jlink导致该问题发生。
迅联NRF51822蓝牙开发板--进阶教程(1)程序不能运行问题的解决办法
:首先入门必看资料是在讯联给的资料包里面的EK_TM入门上手资料的几个文档。
很
多人不看入门手册或者扫一下就去操作然后碰到问题又来问我,入门手册都有详细步骤。
每天重复回答这些有详细教程的问题我也没那么大精力。
Keil和jlink的一些问题看群文件2015-10月下的两个文件
keil常见问题.txt和烧写出错问题总结.txt
以下再总结一些程序运行不正常的问题。
这里的介绍都以sdk5.1为基础的。
因为协议栈和sdk的配套的。
而不同版本的协议栈大
小不同可能导致后面所说的一些地址问题不同。
这里讲的是sdk5.1sd6.0
一:程序如果下载不成功在驱动什么都装成功的情况下。
可能是以下的几个问题1:keil的烧写算法没设置
2:将板子用Nrfgo全部擦除一下。
3:供编程算法的ram太小,修改大一点。
二:程序烧写成功但是没正确运行。
1:先烧协议栈再烧程序。
2:协议栈要和sdk是配套的。
群文件中2015-8月下有一个对照文件
SDK、NRFGO stiuo、S110S120等和KEIL各个版本的匹配表
2:如果用的是5.1sdk和6.0的sd那么看一下设置是不是正确。
蓝牙 nRF51822 应用
蓝牙nRF51822 应用(基于低功耗蓝牙技术的温湿度传感器节点的设计)关键字:低功耗蓝牙温湿度传感器nRF51822 SHT11随着兼容蓝牙4.0标准的智能手机逐步普及,低功耗蓝牙技术也面临着越来越广泛的应用。
本设计采用了nRF51822和SHT11设计了一种基于低功耗蓝牙技术的温湿度传感器节点,能够将节点位置的温度和湿度发送给主机用于显示,可广泛应用于家庭、车间、仓库的温湿度监控。
1.引言在智能家居和物联网飞速发展的背景下,基于蓝牙4.0标准的低功耗蓝牙(Bluetooth Low Energy,BLE)技术正被逐步地为人们重视。
随着兼容蓝牙4.0标准的智能手机逐步普及,低功耗蓝牙技术也面临着越来越广泛的应用。
本设计采用了基于BLE技术的nRF51822蓝牙SoC芯片和SHT11温湿度传感器设计了一种基于低功耗蓝牙技术的温湿度传感器节点,能够将节点位置的温度和湿度发送给主机用于显示,可广泛应用于家庭、车间、仓库的温湿度监控。
节点采用了低功耗设计,可用一枚纽扣电池供电,实际使用时间可达1年以上。
2.系统结构本设计的系统结构如图1所示,系统的处理器模块由nRF51822构成,温湿度传感器件采用SHT11,电源采用纽扣电池供电;由处理器模块、温湿度传感器模块、天线模块、电源模块构成的节点与主机通过2.4GHz的低功耗蓝牙信号通信,主机采用智能手机运行信息采集显示的APP。
多个节点可利用应用层协议与主机组成星形网络。
图1 系统结构图3.硬件电路温湿度传感器节点硬件的系统构成如图2所示。
图2 硬件系统结构图3.1 处理器模块处理器模块选用Nordic公司的nRF51822芯片。
nRF51822是具有CORTEX-M0低功耗内核,支持BLE、Gazell等多协议的低功耗高速率射频收发器的SoC。
其具有高集成度、低成本、处理能力强、低功耗、小体积等优势,非常适合低功耗蓝牙产品的应用。
该芯片具有以下特性:具有Cortex-M0内核,片上256KB FLASH,16KB RAM,片内包含支持BLE协议的2.4GHz射频收发器。
nrf51822数据手册_引脚图_参数
nrf51822数据⼿册_引脚图_参数Copyright ? 2014 Nordic Semiconductor ASA. All rights reserved.Reproduction in whole or in part is prohibited without the prior written permission of the copyright holder.nRF51822Multiprotocol Bluetooth ? low energy/2.4 GHz RF System on Chip Product Specification v3.3Key Features2.4 GHz transceiver-93 dBm sensitivity in Bluetooth low energy mode250 kbps, 1 Mbps, 2 Mbps supported data ratesTX Power -20 to +4 dBm in 4 dB stepsTX Power -30 dBm Whisper mode13 mA peak RX, 10.5 mA peak TX (0 dBm)9.7 mA peak RX, 8 mA peak TX (0 dBm) with DC/DCRSSI (1 dB resolution)ARM Cortex-M0 32 bit processor275 µA/MHz running from flash memory150 µA/MHz running from RAMSerial Wire Debug (SWD)S100 series SoftDevice readyMemory256 kB or 128 kB embedded flash program memory16 kB or 32 kB RAMOn-air compatibility with nRF24L seriesFlexible Power ManagementSupply voltage range 1.8 V to 3.6 V4.2 µs wake-up using 16 MHz RCOSC0.6 µA at 3 V OFF mode1.2 µA at 3 V in OFF mode + 1 region RAM retention2.6 µA at 3 V ON mode, all blocks IDLE8/9/10 bit ADC - 8 configurable channels31 General Purpose I/O PinsOne 32 bit and two 16 bit timers with counter modeSPI Master/SlaveLow power comparatorTemperature sensorTwo-wire Master (I2C compatible)UART (CTS/RTS)CPU independent Programmable Peripheral Interconnect (PPI)Quadrature Decoder (QDEC)AES HW encryptionReal Timer Counter (RTC)Package variantsQFN48 package, 6 x 6 mmWLCSP package, 3.50 x 3.83 x 0.50 mmWLCSP package, 3.50 x 3.83 x 0.35 mmWLCSP package, 3.83 x 3.83 x 0.50 mmWLCSP package, 3.83 x 3.83 x 0.35 mmWLCSP package, 3.50 x 3.33 x 0.50 mm Applications Computer peripherals and I/O devices Mouse Keyboard Multi-touch trackpad ?Interactive entertainment devices ?Remote control ?Gaming controller ?Beacons ?Personal Area Networks Health/fitness sensor and monitor devices Medical devices Key-fobs + wrist watches Remote control toysLiability disclaimerNordic Semiconductor ASA reserves the right to make changes without further notice to the product to improve reliability, function or design. Nordic Semiconductor ASA does not assume any liability arising out of the application or use of any product or circuits described herein.Life support applicationsNordic Semiconductor’s products are not designed for use in life support appliances, devices, or systems where malfunction of these products can reasonably be expected to result in personal injury. Nordic Semiconductor ASA customers using or selling these products for use in such applications do so at their own risk and agree to fully indemnify Nordic Semiconductor ASA for any damages resulting from such improper use or sale.Contact detailsFor your nearest distributor, please visit .Information regarding product updates, downloads, and technical support can be accessed through your My Page account on our home page.RoHS and REACH statementNordic Semiconductor's products meet the requirements of Directive 2002/95/EC of the EuropeanParliament and of the Council on the Restriction of Hazardous Substances (RoHS) and the requirements of the REACH regulation (EC 1907/2006) on Registration, Evaluation, Authorization and Restriction of Chemicals. The SVHC (Substances of Very High Concern) candidate list is continually being updated.Complete hazardous substance reports, material composition reports and latest version of Nordic's REACH statement can be found on our website .Main office:Phone: +47 72 89 89 00Fax: +47 72 89 89 89 Otto Nielsens veg 127052 Trondheim NorwayMailing address:Nordic Semiconductor P .O. Box 23367004 TrondheimNorwayDatasheet StatusRevision History StatusDescription Objective Product Specification (OPS)This product specification contains target specifications for product development.Preliminary Product Specification (PPS)This product specification contains preliminary data; supplementary datamay be published from Nordic Semiconductor ASA later.Product Specification (PS)This product specification contains final product specifications. NordicSemiconductor ASA reserves the right to make changes at any timewithout notice in order to improve design and supply the best possibleproduct.DateVersion Description July 2016 3.3Added documentation for the nRF51822 CTAA version of the chip.Added content:Section 9.5 “CTAA WLCSP package” on page 71Section 11.9 “CTAA WLCSP package” on page 118Updated content:Feature list on the front page.Section 2.2.3 “CEAA, CFAC, CTAA, and CTAC WLCSP ball assignment and functions”on page 17Section 3.2.1 “Code organization” on page 22Section 3.2.2 “RAM organization” on page 22Section 3.3 “Memory Protection Unit (MPU)” on page 23Section 7.1.2 “CTAA and CTAC light sensitivity” on page 39Section 7.2 “CTAA and CTAC mechanical strength” on page 39Section 10.6 “Code ranges and values” on page 76Section 10.7 “Product options” on page 78Chapter 11 “Reference circuitry” on page 79. Added resistor R1 on the schematicsfor all variants.January 2016 3.2Added documentation for the nRF51822 CTAC version of the chip.Added content:Section 4.10.1 “Enable 4 Mbps SPIS bit rate” on page35Section 7.2 “CTAA and CTAC mechanical strength” on page39Section 9.6 “CTAC WLCSP package” on page72Section 11.10 “CTAC WLCSP package” on page124Updated content:Feature list on the front page.Section 2.2.3 “CEAA, CFAC, CTAA, and CTAC WLCSP ball assignment and functions”on page17Section 3.2.1 “Code organization” on page22Section 3.2.2 “RAM organization” on page22Section 3.3 “Memory Protection Unit (MPU)” on page23Chapter 6 “Absolute maximum ratings” on page38Section 7.1 “WLCSP light sensitivity” on page39Section 8.1.2 “16 MHz crystal oscillator (16M XOSC)” on page41Section 8.1.5 “32.768 kHz crystal oscillator (32k XOSC)” on page43Section 8.1.6 “32.768 kHz RC oscillator (32k RCOSC)” on page44Section 8.2 “Power management” on page45Section 8.8 “Serial Peripheral Interface Slave (SPIS) specifications” on page57 Section 10.6 “Code ranges and values” on page76Section 10.7 “Product options” on page78October 2014 3.1Added documentation for the following versions of the chip:nRF51822-QFAC AA0nRF51822-QFAC Ax0nRF51822-CDAB AA0nRF51822-CDAB Ax0nRF51822-CFAC AA0nRF51822-CFAC Ax0(The x in the build codes can be any number between 0 and 9.)Added content:Section 2.2.2 “CDAB WLCSP ball assignment and functions” on page14Section 9.2 “CDAB WLCSP package” on page68Section 9.4 “CFAC WLCSP package” on page70Updated content:Feature list on the front page.Section 2.2.3 “CEAA and CFAC WLCSP ball assignment and functions” on page17 Section 3.2.1 “Code organization” on page22Section 3.2.2 “RAM organization” on page22Section 3.3 “Memory Protection Unit (MPU)” on page23Section 8.2 “Power management” on page45Section 8.3 “Block resource requirements” on page49Section 8.12 “Analog to Digital Converter (ADC) specifications” on page61Section 10.6 “Code ranges and values” on page76Section 10.7 “Product options” on page78August 2014 3.0Update to reflect the changes in build code:nRF51822-QFAA Hx0nRF51822-CEAA Ex0nRF51822-QFAB Cx0(The x in the build codes can be any number between 0 and 9.)If you are working with a previous revision of the chip, read version 2.x of the document. Added content:Section 8.5.3 “Radio current consumption with DC/DC enabled” on page51Section 11.1.1 “PCB layout example” on page80Updated content:Feature list on the front page.Section 2.1 “Block diagram” on page11Section 3.2.1 “Code organization” on page22Section 3.2.2 “RAM organization” on page22Section 3.3 “Memory Protection Unit (MPU)” on page23Section 3.4 “Power management (POWER)” on page24Section 3.6 “Clock management (CLOCK)” on page28Section 3.8 “Debugger support” on page31Section 4.2 “Timer/counters (TIMER)” on page33Chapter 5 “Instance table” on page37Chapter 7 “Operating conditions” on page39Section 8.1.2 “16 MHz crystal oscillator (16M XOSC)” on page41Section 8.1.3 “32 MHz crystal oscillator (32M XOSC)” on page42Section 8.1.4 “16 MHz RC oscillator (16M RCOSC)” on page43Section 8.1.6 “32.768 kHz RC oscillator (32k RCOSC)” on page44Section 8.1.7 “32.768 kHz Synthesized oscillator (32k SYNT)” on page44Section 8.2 “Power management” on page45Section 8.3 “Block resource requirements” on page49Section 8.4 “CPU” on page49Section 8.5.6 “Radio timing parameters” on page55Section 8.5.7 “Antenna matching network requirements” on page55Section 8.7 “Universal Asynchronous Receiver/Transmitter (UART) specifications”on page56Section 8.8 “Serial Peripheral Interface Slave (SPIS) specifications” on page57Section 8.12 “Analog to Digital Converter (ADC) specifications” on page61Section 8.13 “Timer (TIMER) specifications” on page62Section 8.15 “Temperature sensor (TEMP)” on page62Section 8.22 “Non-Volatile Memory Controller (NVMC) specifications” on page65Section 8.24 “Low Power Comparator (LPCOMP) specifications” on page66Section 9.2 “CDAB WLCSP package” on page68Section 10.7.2 “Development tools” on page78Chapter 11 “Reference circuitry” on page79October 2013 2.0This version of the document will target the nRF51822 QFAA G0 revision of the chip. If you are working with a previous revision of the chip, read version 1.3 or earlier of thedocument.Updated the following sections:Key Feature list on the front page,Chapter 1 “Introduction” on page10,Section 2.1 “Block diagram” on page11,Section 2.2 “Pin assignments and functions” on page12,Section 3.2 “Memory” on page21,Section 3.5 “Programmable Peripheral Interconnect (PPI)” on page27,Section 3.7 “GPIO” on page31,Section 4.1 “2.4 GHz radio (RADIO)” on page32,Section 4.2 “Timer/counters (TIMER)” on page33,Section 4.3 “Real Time Counter (RTC)” on page33,Section 4.10 “Serial Peripheral Interface (SPI/SPIS)” on page35,Section 4.12 “Universal Asynchronous Receiver/Transmitter (UART)” on page36,Section 4.14 “Analog to Digital Converter (ADC)” on page36,Section 4.15 “GPIO Task Event blocks (GPIOTE)” on page36,Chapter 5 “Instance table” on page37,Chapter 6 “Absolute maximum ratings” on page38,Chapter 8 “Electrical specifications” on page40,Section 8.1 “Clock sources” on page40,Section 8.1.2 “16 MHz crystal oscillator (16M XOSC)” on page41,Section 8.1.3 “32 MHz crystal oscillator (32M XOSC)” on page42,Section 8.2 “Power management” on page45,Section 8.3 “Block resource requirements” on page49,Section 8.7 “Universal Asynchronous Receiver/Transmitter (UART) specifications” on page56,Section 8.9 “Serial Peripheral Interface (SPI) Master specifications” on page58,Section 8.11 “GPIO Tasks and Events (GPIOTE) specifications” on page60,Section 8.13 “Timer (TIMER) specifications” on page62,Section 8.16 “Random Number Generator (RNG) specifications” on page63,Section 8.17 “AES Electronic Codebook Mode Encryption (ECB) specifications” on page63, Section 8.18 “AES CCM Mode Encryption (CCM) specifications” on page63,Section 8.19 “Accelerated Address Resolver (AAR) specifications” on page63,Section 8.21 “Quadrature Decoder (QDEC) specifications” on page64,Section 11.1 “PCB guidelines” on page79,Section 11.3 “QFAA QFN48 package” on page82, andSection 11.7 “CEAA WLCSP package” on page106.Added the following sections:Section 3.3 “Memory Protection Unit (MPU)” on page23,Section 4.5 “AES CCM Mode Encryption (CCM)” on page34,Section 4.6 “Accelerated Address Resolver (AAR)” on page34,Section 4.16 “Low Power Comparator (LPCOMP)” on page36,Section 8.5.7 “Antenna matching network requirements” on page55,Section 8.8 “Serial Peripheral Interface Slave (SPIS) specifications” on page57,Section 8.18 “AES CCM Mode Encryption (CCM) specifications” on page63,Section 8.19 “Accelerated Address Resolver (AAR) specifications” on page63, and Section 8.24 “Low Power Comparator (LPCOMP) specifications” on page66.May 2013 1.3Updated schematics and BOMs in section 11.3 on page 61.April 2013 1.2Added chip variant nRF51822-CEAA. Updated feature list on front page. UpdatedSection 3.2.1 on page 15, Section 3.2.2 on page 15, Chapter 6 on page 28,Section 10.4 on page 52, and Section 10.5.1 on page 53.AddedSection 2.2.2 on page 10, Section 7.1 on page 29, Section 9.2 on page 50,and Section 11.3 on page 61.Removed PCB layouts in Chapter 11 on page 54.March 2013 1.1Added chip variant nRF51822-QFAB. Added 32 MHz crystal oscillator feature. Updated feature list on front page. Moved subsection ‘Calculating current when the DC/DCconverter is enabled’ from chapter 8 to the nRF51 Series Reference Manual.UpdatedChapter 1 on page 6, Section 2.2 on page 8, Section 3.2 on page 12,Section 3.5 on page 16, Section 3.5.1 on page 17, Section 4.2 on page 21, Chapter 5 onpage 24, Section 8.1 on page 27, Section 8.1.2 on page 28, Section 8.1.5 on page 30,Section 8.2 on page 32, Section 8.3 on page 34, Section 8.5.3 on page 36, Section 8.8 onpage 40, Section 8.9 on page 41, Section 8.10 on page 42, Section 8.14 on page 43,Chapter 10 on page 47, Section 11.2 on page 51, Section 11.3 on page 54, andSection 11.4 on page 57.AddedSection 3.5.4 on page 19, Section 8.1.3 on page 29, andSection 11.1 on page 50.November 2012 1.0Changed from PPS to PS. Updated the feature list on the front page.UpdatedTable 11 on page 25, Table 12 on page 26, Table 14 on page 28,Table 15 on page 28, Table 16 on page 29, Table 17 on page 29,Table 18 on page 30, Table 19 on page 31, Table 21 on page 32,Table 22 on page 32, Table 23 on page 33,Table 27 on page 36,Table 28 on page 37, Table 29 on page 37, Table 31 on page 38,Table 32 on page 38, Table 35 on page 39, Table 38 on page 40,Table 39 on page 40, Table 55 on page 47, Figure 9 on page 48, andTable 57 on page 50.Table of contents1Introduction (10)1.1Required reading (10)1.2Writing conventions (10)2Product overview (11)2.1Block diagram (11)2.2Pin assignments and functions (12)3System blocks (20)3.1CPU (20)3.2Memory (21)3.3Memory Protection Unit (MPU) (23)3.4Power management (POWER) (24)3.5Programmable Peripheral Interconnect (PPI) (27)3.6Clock management (CLOCK) (28)3.7GPIO (31)3.8Debugger support (31)4Peripheral blocks (32)4.1 2.4 GHz radio (RADIO) (32)4.2Timer/counters (TIMER) (33)4.3Real Time Counter (RTC) (33)4.4AES Electronic Codebook Mode Encryption (ECB) (33)4.5AES CCM Mode Encryption (CCM) (34)4.6Accelerated Address Resolver (AAR) (34)4.7Random Number Generator (RNG) (34)4.8Watchdog Timer (WDT) (34)4.9Temperature sensor (TEMP) (35)4.10Serial Peripheral Interface (SPI/SPIS) (35)4.11Two-wire interface (TWI) (35)4.12Universal Asynchronous Receiver/Transmitter (UART) (36)4.13Quadrature Decoder (QDEC) (36)4.14Analog to Digital Converter (ADC) (36)4.15GPIO Task Event blocks (GPIOTE) (36)4.16Low Power Comparator (LPCOMP) (36)5Instance table (37)6Absolute maximum ratings (38)7Operating conditions (39)7.1WLCSP light sensitivity (39)7.2CTAA and CTAC mechanical strength (39)8Electrical specifications (40)8.1Clock sources (40)8.2Power management (45)8.3Block resource requirements (49)8.4CPU (49)8.5Radio transceiver (50)8.6Received Signal Strength Indicator (RSSI) specifications (55)8.7Universal Asynchronous Receiver/Transmitter (UART) specifications (56)8.8Serial Peripheral Interface Slave (SPIS) specifications (57)8.9Serial Peripheral Interface (SPI) Master specifications (58)8.10I2C compatible Two Wire Interface (TWI) specifications (59)8.11GPIO Tasks and Events (GPIOTE) specifications (60)8.12Analog to Digital Converter (ADC) specifications (61)8.13Timer (TIMER) specifications (62)8.14Real Time Counter (RTC) (62)8.15Temperature sensor (TEMP) (62)8.16Random Number Generator (RNG) specifications (63)8.17AES Electronic Codebook Mode Encryption (ECB) specifications (63) 8.18AES CCM Mode Encryption (CCM) specifications (63)8.19Accelerated Address Resolver (AAR) specifications (63)8.20Watchdog Timer (WDT) specifications (64)8.21Quadrature Decoder (QDEC) specifications (64)8.22Non-Volatile Memory Controller (NVMC) specifications (65)8.23General Purpose I/O (GPIO) specifications (66)8.24Low Power Comparator (LPCOMP) specifications (66)9Mechanical specifications (67)9.1QFN48 package (67)9.2CDAB WLCSP package (68)9.3CEAA WLCSP package (69)9.4CFAC WLCSP package (70)9.5CTAA WLCSP package (71)9.6CTAC WLCSP package (72)10Ordering information (73)10.1Chip marking (73)10.2Inner box label (73)10.3Outer box label (74)10.4Order code (74)10.5Abbreviations (75)10.6Code ranges and values (76)10.7Product options (78)11Reference circuitry (79)11.1PCB guidelines (79)11.2Reference design schematics (81)11.3QFAA QFN48 package (82)11.4QFAB QFN48 package (88)11.5QFAC QFN48 package (94)11.6CDAB WLCSP package (100)11.7CEAA WLCSP package (106)11.8CFAC WLCSP package (112)11.9CTAA WLCSP package (118)11.10CTAC WLCSP package (124)12Glossary (130)万联芯城专注电⼦元器件配单服务,只售原装现货库存,万联芯城电⼦元器件全国供应,专为终端⽣产,研发企业提供现货物料,价格优势明显,BOM配单整单采购可享优惠价,提交BOM表报价,最快可当天发货,电⼦元器件现货销售,满⾜客户物料需求,万联芯城凭借丰富的电⼦元器件供应链体系已在业内打下良好的品牌⼝碑,完整PDF资料点击进⼊万联芯城。
讯联电子nRF51822实战教程--2.4G无线通讯
讯联电子
nRF51822实战--2.4G无线通讯
申明:本教程版权归讯联电子所有。本教程仅供 内部客户交流之用。如需引用,请注明出处。由 于工程师水平有限,文档难免有所疏漏和错误, 由此造成的损失,讯联电子不承当任何责任。
1 目的
2块nRF51822EK_TM蓝牙开发板通过2.4G自定义的信道进行数据传输。一块开发板烧录发射程序 (我们称之为A);另一块开发板烧录接收程序(我们称之为B)。当A的按钮BUTTON0被按下的时 候,A在指定的信道上发送0X00 、0X01、 0X02 、0X03四个数据;B每接收到一次正确的数据会驱动蜂 鸣器发出声音,同时七彩灯会发红色的光,200mS以后蜂鸣器停止发声,七彩灯熄灭。TX和RX的源代 码在nRF51822EK_TM开发板配套资料的<实战演练>文件夹内。
讯联电子
4.3.2 IO和系统初始化:
nRF51822实战--2.4G无线通讯
4.4 程序的验证ຫໍສະໝຸດ 把工程编译好以后,在MDK开发环境或者NRFGO STUDIO烧录软件把HEX烧录到nRF51822EK_TM开发板中。按发射端的 BUTTON 0,接收端的蜂鸣器会发出声音。
MAXLEN:数据包的最大长度。nRF51822的无线数据包最大长度为256字节,超过这个长度的数据包将会被截掉。 STALEN: 如果我们发送的数据包是固定长度,则可以设定这个字段,每次按固定的长度发送数据,不超过 256字节。 BALEN:前这个字段可以用来设定前面说的8个逻辑地址中BASEX的长度。 ENDIAN:用来设定发送数据的时候是先高位还是低位。 WHITEEN:打开或者关闭数据数据白化(加噪)功能。
发送地址(TXADDRESS):发送地址是对应于发射端而言的。前面说到,用户可以设定8个逻辑地址,在收发器 初始化的时候,必须要选择8个逻辑地址中的一个作为当前发射器的设备地址。然后,当发送数据的时 候,收发器会自动把设备地址添加到数据帧中把数据发出去。
nRF51822 模块 规格说明书
OHTCOMTechnology Ltd.nRF51822模块规格说明书Datasheet of nRF51822 Modules2015.6.1目录1 简介 Introduction (3)2 nRF51822 M0 BLE模块介绍 specification for M0 Module . 4天线的连接 (7)程序的烧录 (8)表一 nRF51822 M0工作参数 (8)3 nRF51822 M1 BLE模块介绍 specification for M1 Module . 9程序的烧录 (11)表二 nRF51822 M1工作参数 (11)4 History (13)5 联系方式CONTACT US (14)NOTES:If you are customers from overseas, please contact sales@ for quotation and specifications of English version.1 简介IntroductionnRF51822 Mx BLE低功耗蓝牙模块目前包括nRF51822 M0、nRF51822 M1两款。
这两款BLE模块都是以nRF51822为主控芯片,封装不同的模块。
nRF51822 M0模块包含了LIS3DH3轴传感器,与百度手环使用相同的基础硬件,可以用来开发运动手环等穿戴设备。
nRF51822 M1模块单有一片nRF51822芯片,可以选择16kB RAM或者32kB RAM的不同版本,可以用来开发iBeacon、室内定位、穿戴设备,计算机控制等,应用更灵活,满足不同需求。
nRF51822 M0nRF51822 M12 nRF51822 M0 BLE模块介绍specification for M0 ModulenRF51822 M0采用BGA的nRF51822芯片封装并且集成了高低速晶振、LIS3DH三轴传感器,模块尺寸仅为10.5mm*8.5mm*1.5mm,为业界最小封装。
nRF51822_PS_v1.3_CN 20130830
Life support applications
Nordic Semiconductor’s products are not designed for use in life support appliances, devices, or systems where malfunction of these products can reasonably be expected to result in personal injury. Nordic Semiconductor ASA customers using or selling these products for use in such applications do so at their own risk and agree to fully indemnify Nordic Semiconductor ASA for any damages resulting from such improper use or sale.
Main office: Otto Nielsens veg 12
7052 Trondheim Norway
Phone: +47 72 89 89 00 Fax: +47 72 89 89 89
Mailing address: Nordic Semiconductor
P.O. Box 2336 7004 Trondheim Norway
Product Specification (PS)
Revision History
Date
May 2013 April 2013
Version
1.3 1.2
Description
Updated schematics and BOMs in Section 11.3 on page 61. Added chip variant nRF51822-CEAA. Updated feature list on front page. Updated Section 3.2.1 on page 15, Section 3.2.2 on page 15, Chapter 6 on page 28, Section 10.4 on page 52, and Section 10.5.1 on page 53. Added Section 2.2.2 on page 10, Section 7.1 on page 29, Section 9.2 on page 50, and Section 11.3 on page 61. Removed PCB layouts in Chapter 11 on page 54. Added chip variant nRF51822-QFAB. Added 32 MHz crystal oscillator feature. Updated feature list on front page. Moved subsection ‘Calculating current when the DC/DC converter is enabled’ from chapter 8 to the nRF51 Reference Manual. Updated Chapter 1 on page 6, Section 2.2 on page 8, Section 3.2 on page 14, Section 3.5 on page 18, Section 3.5.1 on page 19, Section 4.2 on page 23, Chapter 5 on page 26, Section 8.1 on page 30, Section 8.1.2 on page 31, Section 8.1.5 on page 33, Section 8.2 on page 35, Section 8.3 on page 37, Section 8.5.3 on page 39, Section 8.8 on page 43, Section 8.9 on page 44, Section 8.10 on page 45, Section 8.14 on page 46, Chapter 10 on page 51, Section 11.2.3 on page 59, Section 11.2.1 on page 55, and Section 11.2.2 on page 57. Added Section 3.5.4 on page 21, Section 8.1.3 on page 32, and Section 11.1 on page 54. Changed from PPS to PS. Updated feature list on front page. Updated Table 13 on page 28, Table 14 on page 29, Table 16 on page 31, Table 18 on page 33, Table 19 on page 33, Table 20 on page 34, Table 23 on page 36, Table 24 on page 37, Table 26 on page 38, Table 27 on page 38, Table 28 on page 39, Table 32 on page 42, Table 33 on page 43, Table 35 on page 44, Table 38 on page 45, Table 39 on page 46, Table 42 on page 47, Table 45 on page 48, Table 46 on page 48, Table 61 on page 53, and Figure 15 on page 59.
nRF51822芯片详解解读
0、功能简介IC功能包括:256kB片上闪存和16kB RAM;数字和混合信号周边,包括SPI、2-wire、ADC以及正交解码器;16 PPI通道;撘配片上LDO时电源范围为1.8-3.6V,LDO旁路模式为1.75-1.95V ;片上下拉DC/DC转换器用于3V电池(例如,纽扣电池);片上+/- 250 ppm 32kHZ RC振荡器,在蓝牙低功耗应用,不需外部32kHz晶体,可节省成本和电路板空间;6x6mm 48脚QFN封装,提供最多可达32个GPIO;完整的蓝牙协议堆栈(到配置文件的链接层)。
nRF51822的S110是可下载、免版税、预编译二进制蓝牙低功耗堆栈,可独立编程和更新。
功能包括:异步和事件驱动SVC的API;运行时保护;GATT、GAP和L2CAP级别API;周边和广播器角色;GATT客户端和服务器;和2.4GHz RF专用协议的非并行多协议操作;少于128kB的代码和6kB的RAM,为应用程序留有超过128kB的闪存和10kB的RAM;与使用上一代nRF8001的双芯片应用相比,运行S110堆栈的nRF51822削减了高达50%的功耗。
S110堆栈和nRF51822加上nRF518 SDK相互配合,nRF518包含全面的蓝牙低功耗配置文件、服务以及示例应用集合。
1、架构围绕两条内部总线展开:AHB,APB AHB (Advanced High Performance BUS):CPU: ( Cortex-m0,NVIC,BBB,DAP)Memory : ( RAM, Flash)GPIO : P0(P0.0~P0.31)AHB to APB BridgeAPB (Advanced Peripheral BUS):左半边:Power:电源控制WDT:看门狗SPI0,SPI1TIMER0(32位),TIMER1(16位),TIMER2(16位)QDEC:正交译码器,CLOCK:提供两个时钟:HFCLK(16MHZ),LFCLK(32.768KHZ)TWI0,TWI1:两线接口,兼容I2C右半边:NVMC :非易失性存储控制器RADIO: 2.4GHZ 无线广播的数据率:250KBPS,1MBPS,2MBPS ECB: 加密功能(AES),产生HASH序列,数字签名,生成密钥流等RNG:产生随机数用于加密(基于内部热噪声),无需种子值。
2.4GRF协议BLE蓝牙4.0协议芯片NRF51822介绍
发布时间:2012-11-01 16:54:202.4GRF协议BLE蓝牙4.0协议芯片NRF51822介绍技术类别:资源共享关于 nRF51 系列多协议 2.4GHz 射频收发器拥有高性能、超低功耗以及灵活性等好处。
它的主要功能包括:在蓝牙低功耗模式下灵敏度为-92.5dB RX,高达 +4dBm 的输出功率;与 Nordic 上一代射频收发器相比,链接预算增强高达 9.5dBm;低于10mA 的峰值电流适合3V 纽扣电池;符合蓝牙低功耗(蓝牙 4.0 )标准;与 Nordic 现有的 nRF24L 系列 IC 空中完全兼容;支持包括蓝牙低功耗、ANT 和专有 2.4GHz 等协议的非并行和并行操作;场强RSSI。
nRF51 系列 SoC 大大地降低平均电流,使单芯片适用于各种无线应用。
它的主要功能包括:功能强大且低功耗的 32 位 ARM Cortex-M0 处理器,启动时间为 2µs,与 8/16 位处理器相比,大限度地降低了活动时间并提高了代码密度;细化电源管理,个别系统可独立开关,并能基于活动级别自主控制时钟;可编程周边互连 (PPI) 系统。
周边设备,如射频收发器、计时器及 I/O等,不需通过处理器而能自主相互作用。
从而降低处理器的活动时间来节省功耗,并放宽对处理器实时要求。
高效的EasyDMA射频收发器接口具有弹性 RAM 映射 FIFO;高灵活性的GPIO 映射简化了 PCB 设计,有助降低布线板层数量;自定义 2 区内存保护装置 (MPU) 对用户程序和预编译协议堆栈例如蓝牙低功耗和 ANT运行时保护。
nRF51 系列软件架构在协议堆栈和用户应用程序间具有一个独特且功能强大的分隔区,为应用程序开发人员提供最大的灵活性、开发简易性和代码安全性。
协议堆栈,例如蓝牙低功耗或 ANT,可为预编译二进制码或在设备上预编程;堆栈为 100% 异步并由事件驱动,并向应用程序层提供线程安全管理程序调用 (SVC) 的应用程序接口 (API);简单的编程模型,没有专用的应用程序框架或计划程序/RTOS 依存性,简化并加速了代码开发;协议堆栈和应用程序代码没有链接时间依存性,并可独立编译和更新/编程;堆栈受运行时保护,确保相互操作性并将应用程序错误而影响堆栈的风险降低;堆栈可以验证码和合格二进制目的码提供。
NRF51822RADIO中文资料
NRF51822RADIO中⽂资料16 ----2.4 GHz radio (⽆线发射机)The RADIO包括了⼀个2.4G的接收机和⼀个发射机,它兼容了Nordic的所有2Mbps,1Mbps和250kpbs模式增加了1Mbps的蓝⽛低功耗模式。
The RADIO使⽤EasyDMA,EasyDMA包含⼀个⾃动压包和解包⼯具,以及CRC发⽣器和CRC校验使对它进⾏⾮常简单的配置,更多信息查看上图。
The RADIO包含了⼀个设备地址匹配单元和⼀个内部框架分隔单元。
它可以被⽤作简化地址⽩名单和帧间距分隔。
在低功耗蓝⽛和仿真中使⽤。
The RADIO也包含⼀个信号轻度指⽰器(RSSI)和⼀个位计数器,当⼀个预先设定的位通过RADIO被发送或者接受完成时,位计数器会引发⼀个事件。
16.1 功能描述16.1.1 EasyDMAEasyDMA在CPU RAM以内读写数据包,不能通过RAM以外的地址后者代码段读取数据包。
根据上⾯的框图,the RADIO's EasyDMA利⽤PACKETPTR指针接受和发送数据包。
CPU必须配置每⼀次的发送机的发送和接受模式直接的转换,MAXLEN 寄存器配置发射机在同⼀个数据包中的接收或发送的最⼤字节数。
此功能可以被⽤来确定⽆线发送接机所分配的数据包是否被覆盖或者越界。
16.1.2 包配置(Packet configuration)⼀个⽆线数据报⽂,包含以下部分:报头(PREAMBLE),地址(ADDRESS),长度(LENGTH),S0,S1,PAYLOAD(有效载荷:可理解为有效数据。
)和CRC。
⽆线发射机发送上述部分时的顺序展⽰在下图,从左到右,第⼀个发送的是PREAMBLE 位。
报头(PREAMBLE)总是根据第⼀个 ADDRESS位的值在0xAA或者0x55两个数字之间取值。
如果ADDRESS是0则PREAMBLE位为0xAA,否则为0x55.下图展⽰了⽆线数据包在内存中储存实例⽆线电字节顺序:ADDRESS和PAYLOAD低位总是优先的存储⽅式,CRC总是⾼位优先的存储⽅式,,S0,LENGHT,S1和PAYLOAD可以通过PCNF1的ENDIAN 位。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
nRF51822库函数速查nrf_soc.h//初始化互斥锁uint32_t sd_mutex_new(nrf_mutex_t*p_mutex);//尝试获取互斥锁.uint32_t sd_mutex_acquire(nrf_mutex_t*p_mutex);//释放互斥锁.uint32_t sd_mutex_release(nrf_mutex_t*p_mutex);//使能外部中断.uint32_t sd_nvic_EnableIRQ(IRQn_Type IRQn);//禁止外部中断.uint32_t sd_nvic_DisableIRQ(IRQn_Type IRQn);//Get Pending Interrupt.uint32_t sd_nvic_GetPendingIRQ(IRQn_Type IRQn,uint32_t*p_pending_irq);//Set Pending Interrupt.uint32_t sd_nvic_SetPendingIRQ(IRQn_Type IRQn);//Clear Pending Interrupt.uint32_t sd_nvic_ClearPendingIRQ(IRQn_Type IRQn);//设置中断优先级.uint32_t sd_nvic_SetPriority(IRQn_Type IRQn,nrf_app_irq_priority_t priority);//取得中断优先级.uint32_t sd_nvic_GetPriority(IRQn_Type IRQn,nrf_app_irq_priority_t*p_priority); //系统复位.uint32_t sd_nvic_SystemReset(void);//进入临界区.uint32_t sd_nvic_critical_region_enter(uint8_t*p_is_nested_critical_region);//退出临界区.uint32_t sd_nvic_critical_region_exit(uint8_t is_nested_critical_region);//查询应用的随机数池容量.uint32_t sd_rand_application_pool_capacity_get(uint8_t*p_pool_capacity);//取得应用中有效地随机数字节数.uint32_t sd_rand_application_bytes_available_get(uint8_t*p_bytes_available);//从池中获取随机数字节.uint32_t sd_rand_application_vector_get(uint8_t*p_buff,uint8_t length);//取得复位原因寄存器的值.uint32_t sd_power_reset_reason_get(uint32_t*p_reset_reason);//清除复位原因寄存器的若干bit.uint32_t sd_power_reset_reason_clr(uint32_t reset_reason_clr_msk);//设置CPU睡眠时的电源模式.uint32_t sd_power_mode_set(nrf_power_mode_t power_mode);//关闭系统.uint32_t sd_power_system_off(void);//开关电源失效比较器uint32_t sd_power_pof_enable(uint8_t pof_enable);//设置电源故障阈值.uint32_t sd_power_pof_threshold_set(nrf_power_failure_threshold_t threshold);//设置NRF_POWER->RAMON寄存器.uint32_t sd_power_ramon_set(uint32_t ramon);//清除NRF_POWER->RAMON寄存器.uint32_t sd_power_ramon_clr(uint32_t ramon);//Get contents of NRF_POWER->RAMON register,indicates power status of ram blocks. uint32_t sd_power_ramon_get(uint32_t*p_ramon);//Set bits in the NRF_POWER->GPREGRET register.uint32_t sd_power_gpregret_set(uint32_t gpregret_msk);//Clear bits in the NRF_POWER->GPREGRET register.uint32_t sd_power_gpregret_clr(uint32_t gpregret_msk);//Get contents of the NRF_POWER->GPREGRET register.uint32_t sd_power_gpregret_get(uint32_t*p_gpregret);//设置DCDC模式.uint32_t sd_power_dcdc_mode_set(nrf_power_dcdc_mode_t dcdc_mode);//请求使用高频晶体振荡器.uint32_t sd_clock_hfclk_request(void);//释放高频晶体振荡器.uint32_t sd_clock_hfclk_release(void);//检查高频晶体振荡器是否在运行.SVCALL(SD_CLOCK_HFCLK_IS_RUNNING,uint32_t,sd_clock_hfclk_is_running(uint32_t*p_is_running));//等待程序事件.uint32_t sd_app_evt_wait(void);//Get PPI channel enable register contents.uint32_t sd_ppi_channel_enable_get(uint32_t*p_channel_enable);//Set PPI channel enable register.uint32_t sd_ppi_channel_enable_set(uint32_t channel_enable_set_msk);//Clear PPI channel enable register.uint32_t sd_ppi_channel_enable_clr(uint32_t channel_enable_clr_msk);//Assign endpoints to a PPI channel.uint32_t sd_ppi_channel_assign(uint8_t channel_num,const volatile void*evt_endpoint, const volatile void*task_endpoint);//Task to enable a channel group.uint32_t sd_ppi_group_task_enable(uint8_t group_num);//Task to disable a channel group.uint32_t sd_ppi_group_task_disable(uint8_t group_num);//Assign PPI channels to a channel group.uint32_t sd_ppi_group_assign(uint8_t group_num,uint32_t channel_msk);//Gets the PPI channels of a channel group.uint32_t sd_ppi_group_get(uint8_t group_num,uint32_t*p_channel_msk);//配置无线通知信号.uint32_t sd_radio_notification_cfg_set(nrf_radio_notification_type_t type,nrf_radio_notification_distance_t distance);//AES-ECB加密.uint32_t sd_ecb_block_encrypt(nrf_ecb_hal_data_t*p_ecb_data);//Gets any pending events generated by the SoC API.uint32_t,sd_evt_get(uint32_t*p_evt_id);//取得芯片温度uint32_t sd_temp_get(int32_t*p_temp);//写数据到Flashsd_flash_write(uint32_t*const p_dst,uint32_t const*const p_src,uint32_t size); //擦除Flash页uint32_t sd_flash_page_erase(uint32_t page_number);//Flash Protection setuint32_t sd_flash_protect(uint32_t protenset0,uint32_t protenset1);ble.h//从队列中取得等待处理的事件uint32_t,sd_ble_evt_get(uint8_t*p_dest,uint16_t*p_len);//取得BLE协议栈中有效地传输缓冲区总数uint32_t sd_ble_tx_buffer_count_get(uint8_t*p_count);//添加一个厂商特定UUID.uint32_t sd_ble_uuid_vs_add(ble_uuid128_t const*const p_vs_uuid,uint8_t*const p_uuid_type);//解码原始小端UUID字节(16bit或128bit)到24bit的ble_uuid_t结构uint32_t sd_ble_uuid_decode(uint8_t uuid_le_len,uint8_t const*const p_uuid_le, ble_uuid_t*const p_uuid);//编码24bit的ble_uuid_t结构到原始小端UUID字节(16bit或128bit)uint32_t sd_ble_uuid_encode(ble_uuid_t const*const p_uuid,uint8_t*constp_uuid_le_len,uint8_t*const p_uuid_le));//取得版本信息uint32_t sd_ble_version_get(ble_version_t*p_version);//提供用户内存块uint32_t sd_ble_user_mem_reply(uint16_t conn_handle,ble_user_mem_block_t*p_block); ble_gap.h//设置本地蓝牙MAC地址uint32_t sd_ble_gap_address_set(ble_gap_addr_t const*const p_addr);//取得本地蓝牙MAC地址uint32_t sd_ble_gap_address_get(ble_gap_addr_t*const p_addr);//设置,清除,更新广播扫描响应数据uint32_t sd_ble_gap_adv_data_set(uint8_t const*const p_data,uint8_t dlen,uint8_t const*const p_sr_data,uint8_t srdlen);//开始广播(Start advertising(GAP Discoverable,Connectable modes,Broadcast Procedure) uint32_t sd_ble_gap_adv_start(ble_gap_adv_params_t const*const p_adv_params);//停止广播(Start advertising(GAP Discoverable,Connectable modes,Broadcast Procedure) uint32_t sd_ble_gap_adv_stop(void);//更新连接参数uint32_t sd_ble_gap_conn_param_update(uint16_t conn_handle,ble_gap_conn_params_t const*const p_conn_params);//断开连接(GAP Link Termination).uint32_t,sd_ble_gap_disconnect(uint16_t conn_handle,uint8_t hci_status_code);//设置无线发射功率dBm(accepted values are-40,-30,-20,-16,-12,-8,-4,0,and4dBm). SVCALL(SD_BLE_GAP_TX_POWER_SET,uint32_t,sd_ble_gap_tx_power_set(int8_t tx_power)) ;//Set GAP Appearance value.uint32_t sd_ble_gap_appearance_set(uint16_t appearance);//Get GAP Appearance value.uint32_t,sd_ble_gap_appearance_get(uint16_t*const p_appearance);//设置GAP外设优先连接参数uint32_t sd_ble_gap_ppcp_set(ble_gap_conn_params_t const*const p_conn_params);//取得GAP外设优先连接参数uint32_t sd_ble_gap_ppcp_get(ble_gap_conn_params_t*const p_conn_params);//设置GAP设备名uint32_t sd_ble_gap_device_name_set(ble_gap_conn_sec_mode_t const*const p_write_perm, uint8_t const*const p_dev_name,uint16_t len);//取得GAP设备名uint32_t,sd_ble_gap_device_name_get(uint8_t*const p_dev_name,uint16_t*constp_len);//启动GAP认证流程uint32_t,sd_ble_gap_authenticate(uint16_t conn_handle,ble_gap_sec_params_t const* const p_sec_params);//Reply with GAP security parameters.uint32_t sd_ble_gap_sec_params_reply(uint16_t conn_handle,uint8_t sec_status,ble_gap_sec_params_t const*const p_sec_params);//Reply with an authentication keySVCALL(SD_BLE_GAP_AUTH_KEY_REPLY,uint32_t,sd_ble_gap_auth_key_reply(uint16_tconn_handle,uint8_t key_type,uint8_t const*const key);//Reply with GAP security information.uint32_t sd_ble_gap_sec_info_reply(uint16_t conn_handle,ble_gap_enc_info_t const* const p_enc_info,ble_gap_sign_info_t const*const p_sign_info);//Get the current connection security.uint32_t,sd_ble_gap_conn_sec_get(uint16_t conn_handle,ble_gap_conn_sec_t*const p_conn_sec);//开始接受RSSI值的变化通知uint32_t sd_ble_gap_rssi_start(uint16_t conn_handle);//停止接收RSSI值变化通知SVCALL(SD_BLE_GAP_RSSI_STOP,uint32_t,sd_ble_gap_rssi_stop(uint16_t conn_handle); ble_gattc.h//启动或继续GATT主要服务的发现过程uint32_t sd_ble_gattc_primary_services_discover(uint16_t conn_handle,uint16_tstart_handle,ble_uuid_t const*const p_srvc_uuid);//启动或继续GATT关系发现过程uint32_t sd_ble_gattc_relationships_discover(uint16_t conn_handle,ble_gattc_handle_range_t const*const p_handle_range);//启动或继续GATT特性发现过程uint32_t sd_ble_gattc_characteristics_discover(uint16_t conn_handle,ble_gattc_handle_range_t const*const p_handle_range);//启动或继续GATT特性描述发现过程uint32_t sd_ble_gattc_descriptors_discover(uint16_t conn_handle,ble_gattc_handle_range_t const*const p_handle_range);//启动或继续通过GATT特性的UUID的读操作uint32_t sd_ble_gattc_char_value_by_uuid_read(uint16_t conn_handle,ble_uuid_t const *const p_uuid,ble_gattc_handle_range_t const*const p_handle_range);//启动或继续GATT读取长特性或描述的过程uint32_t sd_ble_gattc_read(uint16_t conn_handle,uint16_t handle,uint16_t offset); //启动GATT读取多个特性值的过程uint32_t sd_ble_gattc_char_values_read(uint16_t conn_handle,uint16_t const*const p_handles,uint16_t handle_count);//执行一个无报告的写操作uint32_t sd_ble_gattc_write(uint16_t conn_handle,ble_gattc_write_params_t const* const p_write_params);//发送配置到GATT服务器uint32_t sd_ble_gattc_hv_confirm(uint16_t conn_handle,uint16_t handle);ble_gatts.h//添加一个服务声明到本地服务的ATT表uint32_t sd_ble_gatts_service_add(uint8_t type,ble_uuid_t const*const p_uuid,uint16_t*const p_handle);//添加一个包含声明到本地服务的ATT表uint32_t sd_ble_gatts_include_add(uint16_t service_handle,uint16_t inc_srvc_handle, uint16_t*const p_include_handle);//添加特性声明,特性值声明,可选的特性描述声明到ATT表uint32_t sd_ble_gatts_characteristic_add(uint16_t service_handle,ble_gatts_char_md_t const*const p_char_md,ble_gatts_attr_t const*const p_attr_char_value,ble_gatts_char_handles_t*const p_handles);//添加描述到ATT表uint32_t sd_ble_gatts_descriptor_add(uint16_t char_handle,ble_gatts_attr_t const* const p_attr,uint16_t*const p_handle);//设置值到特性uint32_t sd_ble_gatts_value_set(uint16_t handle,uint16_t offset,uint16_t*const p_len, uint8_t const*const p_value);//取得属性值uint32_t sd_ble_gatts_value_get(uint16_t handle,uint16_t offset,uint16_t*const p_len, uint8_t*const p_data);//Notify或Indicate特性值.uint32_t,sd_ble_gatts_hvx(uint16_t conn_handle,ble_gatts_hvx_params_t const*constp_hvx_params);//Indicate属性值改变uint32_t sd_ble_gatts_service_changed(uint16_t conn_handle,uint16_t start_handle, uint16_t end_handle);//报告读写授权请求uint32_t sd_ble_gatts_rw_authorize_reply(uint16_t conn_handle,ble_gatts_rw_authorize_reply_params_t const*const p_rw_authorize_reply_params);//Update persistent system attribute informationuint32_t sd_ble_gatts_sys_attr_set(uint16_t conn_handle,uint8_t const*constp_sys_attr_data,uint16_t len);//Retrieve persistent system attribute information from the stack.uint32_t sd_ble_gatts_sys_attr_get(uint16_t conn_handle,uint8_t*constp_sys_attr_data,uint16_t*const p_len);ble_l2cap.h//注册一个L2CAP的CIDuint32_t sd_ble_l2cap_cid_register(uint16_t cid);//注销CIDuint32_t sd_ble_l2cap_cid_unregister(uint16_t cid);//发送L2CAP包uint32_t sd_ble_l2cap_tx(uint16_t conn_handle,ble_l2cap_header_t const*const p_header,uint8_t const*const p_data);nrf_sdm.h//使能SoftDeviceuint32_t sd_softdevice_enable(nrf_clock_lfclksrc_t clock_source,softdevice_assertion_handler_t assertion_handler);//禁用SoftDeviceuint32_t sd_softdevice_disable(void);//检查SoftDevice是否已使能uint32_t sd_softdevice_is_enabled(uint8_t*p_softdevice_enabled);//开始转发中断到应用程序uint32_t sd_softdevice_forward_to_application(void);。