没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
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.
Creating Bluetooth® Low Energy Applications
Using nRF51822
nAN-36
Application Note v1.1
This application note is intended for anyone who would like to begin programming Bluetooth low energy
(BLE) applications on nRF51822. It consists of a general overview of BLE functionality and is followed by a
description of a simple example program that implements a custom service, the LED Button service.
Page 2
Creating Bluetooth low energy applications using nRF51822 Application Note v1.1
1 Introduction
The purpose of this application note is to show you the steps necessary for creating your own BLE
application, including a custom service, using the nRF51822 chip.
1.1 Minimum requirements
Experience in embedded C programming is needed to fully understand this application note.
1.1.1 Required tools
The nRF51822 Evaluation Kit is needed for this application note. Additionally, the following tools should be
downloaded and installed:
• S110 SoftDevice
•nRFgo Studio
• nRF51 SDK
•Keil MDK-ARM
• SEGGER’s J-Link tools
Program the S110 SoftDevice onto the chip using the instructions in the nRF51822 Evaluation Kit User Guide.
Note: nRF51 SDK version 5.2.0 and S110 SoftDevice version 6.0.0 were the latest versions and the
ones used as reference when this document was written.
Page 3
Creating Bluetooth low energy applications using nRF51822 Application Note v1.1
1.2 Documentation
The following documentation is important reference material:
1.3 Bluetooth resources
All Bluetooth SIG services, characteristics, and descriptors are defined on the Bluetooth Developer Portal
which can be used as a reference for finding UUIDs or data formats used by different parts of the
specification.
1.4 nRF51822 and the S110 SoftDevice
The S110 SoftDevice is a BLE Peripheral protocol stack solution. It integrates a low energy controller and
host, and provides a full and flexible API for building Bluetooth low energy System on Chip (SoC) solutions.
The S110 SoftDevice is provided as a precompiled HEX file that must be programmed onto the chip before
your application is loaded.
The SoftDevice uses a portion of the chip’s flash and RAM, but they are protected from your code, so that
you can’t accidentally write to these areas. The SoftDevice also needs exclusive access to some peripherals
and registers.
For information on how to program the SoftDevice into the nRF51822 chip, see the nRF51822 Evaluation Kit
User Guide. For information on which resources the SoftDevice uses, see the nRF51822 S110 SoftDevice
Specification.
Document Description
nRF51822 Evaluation Kit User Guide
Contains information about setting up and using the Evaluation Kit, including
setting up Keil and the SoftDevice.
nRF51 SDK documentation
This is available in the Documentation subfolder of the SDK installation folder,
contains API documentation for all functions in the SDK and also from the Nordic
Developer Zone.
S110 nRF51822 SoftDevice Specification
Contains information about the S110 SoftDevice, including resource usage and
high-level functionality.
nRF51822 Product Specification
Contains a description of the hardware, modules, and electrical specifications
specific to the nRF51822 chip.
nRF51 Series Reference Manual
Contains a functional description of all the modules and peripherals supported
for all the chips in the nRF51 series.
nAN-15: Creating Applications with the
Keil C51 Compiler
This application note contains information about using Keil μVision. It was
originally written for the nRF24LE1 chip, but Section 3.3 “Including files” and
Section 3.4 “Debug your project” are also relevant for the nRF51822 chip.
Bluetooth Core Specification, version 4.0,
Volumes 1, 3, 4, and 6
Provided by the Bluetooth SIG, this document contains information relating to
Bluetooth services and profiles.
Page 4
Creating Bluetooth low energy applications using nRF51822 Application Note v1.1
1.5 Application overview
The LED Button application example was created in order to give you an environment where you can learn
how to use Bluetooth low energy on the nRF51822 chip. It is a simple BLE application that demonstrates bi-
directional communication over BLE. When it is running, you will be able to toggle an LED output on the
nRF51822 chip from the Central (see Section 2.1.1 “Roles” on page 5 for a definition of the Central), and
receive a notification when button input on nRF51822 is pressed.
The application is implemented in one service (see Section 2.2.2 “GATT hierarchy” on page 7 for a
description of a service and characteristics), with two characteristics: the LED characteristic, which can be
used to control the LED remotely through the write without response operation, and the Button
characteristic, which sends a notification when the button is pressed.
Page 5
Creating Bluetooth low energy applications using nRF51822 Application Note v1.1
2 Introduction to Bluetooth low energy
This chapter describes the different layers of the BLE protocol, the components within these layers, and their
concepts.
Figure 1 Protocol stack components and layers
2.1 Generic Access Profile (GAP)
GAP is the lowest layer of the Bluetooth stack that an application interfaces with. It includes parameters that
govern advertising and connection among other things.
Note: GAP is covered in more detail in Volume 3, Part C of the Bluetooth Core Specification.
2.1.1 Roles
In creating and maintaining a BLE link, certain roles are involved. A BLE device is either a Central or a
Peripheral, with the definition depending on the initiator of the link. The Central is always the device that
initiates the connection, while the Peripheral is the device that is connected to. The terms Master and Slave
are the Link Layer roles equivalent to Central and Peripheral.
In addition to the Central and Peripheral roles, the Bluetooth Core Specification defines Observer and
Broadcaster roles. Observers listen to what’s happening on the air and Broadcasters send but don’t receive
HID over GATT
Proximity
Battery
Thermometer
Heart Rate
Blood Pressure
Speed & Cadence
Profiles Host Controller
GATT
ATT
GAP
SMP
L2CAP
Host Controller Interface (HCI)
Link Layer (LL)
Physical Layer (PHY)
In the LED Button application, the nRF51822 chip programmed with the S110 SoftDevice will
be the Peripheral, and either a computer or phone will be the Central.
剩余37页未读,继续阅读
资源评论
SuperAraboy
- 粉丝: 0
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功