Microchip Technology RN4870, RN4871 User Manual

RN4870/71 Bluetooth
Low Energy Module
User’s Guide
®
2016 Microchip Technology Inc. DS50002466A
Note the following details of the code protection feature on Microchip devices:
YSTEM
CERTIFIE DBYDNV
== ISO/TS16949==
Microchip products meet the specification contained in their particular Microchip Data Sheet.
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
Microchip is willing to work with the customer who is concerned about the integrity of their code.
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer’s risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights unless otherwise stated.
Microchip received ISO/TS-16949:2009 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California and India. The Company’s quality system processes and procedures are for its PIC devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001:2000 certified.
®
MCUs and dsPIC® DSCs, KEELOQ
®
code hopping
QUALITYMANAGEMENTS
Trademarks
The Microchip name and logo, the Microchip logo, AnyRate, dsPIC, FlashFlex, flexPWR, Heldo, JukeBlox, KeeLoq, KeeLoq logo, Kleer, LANCheck, LINK MD, MediaLB, MOST, MOST logo, MPLAB, OptoLyzer, PIC, PICSTART, PIC32 logo, RightTouch, SpyNIC, SST, SST Logo, SuperFlash and UNI/O are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
ClockWorks, The Embedded Control Solutions Company, ETHERSYNCH, Hyper Speed Control, HyperLight Load, IntelliMOS, mTouch, Precision Edge, and QUIET-WIRE are registered trademarks of Microchip Technology Incorporated in the U.S.A.
Analog-for-the-Digital Age, Any Capacitor, AnyIn, AnyOut, BodyCom, chipKIT, chipKIT logo, CodeGuard, dsPICDEM, dsPICDEM.net, Dynamic Average Matching, DAM, ECAN, EtherGREEN, In-Circuit Serial Programming, ICSP, Inter-Chip Connectivity, JitterBlocker, KleerNet, KleerNet logo, MiWi, motorBench, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach, Omniscient Code Generation, PICDEM, PICDEM.net, PICkit, PICtail, PureSilicon, RightTouch logo, REAL ICE, Ripple Blocker, Serial Quad I/O, SQI, SuperSwitcher, SuperSwitcher II, Total Endurance, TSHARC, USBCheck, VariSense, ViewSpan, WiperLock, Wireless DNA, and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.
Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries.
GestIC is a registered trademarks of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in other countries.
All other trademarks mentioned herein are property of their respective companies.
© 2016, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved.
ISBN: 978-1-5224-0515-3
DS50002466A-page 2  2016 Microchip Technology Inc.
Object of Declaration: RN4870/71 Bluetooth® Low Energy Module
2016 Microchip Technology Inc. DS50002466A-page 3
RN4870/71 Bluetooth® Low Energy Module User’s Guide
NOTES:
DS50002466A-page 4  2016 Microchip Technology Inc.
RN4870/71 BLUETOOTH
®
LOW ENERGY MODULE
USER’S GUIDE
Table of Contents
Preface ........................................................................................................................... 7
Chapter 1. Overview
1.1 Introduction ................................................................................................... 11
1.2 Key Features ................................................................................................ 11
1.3 Command Mode and Data Mode ................................................................. 12
1.4 Accessing the RN4870/71 over UART ......................................................... 13
1.5 RN4870 PIO Control Lines ........................................................................... 13
Chapter 2. Command Reference
2.1 Introduction ................................................................................................... 15
2.2 Command Syntax ......................................................................................... 15
2.3 Set and Get Commands ............................................................................... 15
2.4 Set Commands ............................................................................................. 16
2.5 Get Commands ............................................................................................ 26
2.6 Action Commands ........................................................................................ 27
2.7 List Commands ............................................................................................ 39
2.8 Service Configuration Commands ................................................................ 41
2.9 Characteristic Access Commands ............................................................... 43
2.10 Script Commands ....................................................................................... 46
Chapter 3. Embedded Scripting Feature
3.1 Introduction ................................................................................................... 49
Chapter 4. Connection Examples
4.1 Connecting to RN4870 using SmartDiscover App ....................................... 53
4.2 UART Transparent Connection Using SmartData ....................................... 55
4.3 Module to Module Connection ...................................................................... 57
Appendix A. Bluetooth Low Energy Fundamentals
A.1 Introduction .................................................................................................. 59
Appendix B. Status Response Summary Quick Reference
B.1 Introduction .................................................................................................. 61
Worldwide Sales and Service .................................................................................... 65
2015 Microchip Technology Inc. DS50002433A-page 5
RN4870/71 Bluetooth® Low Energy Module User’s Guide
NOTES:
DS50002433A-page 6  2015 Microchip Technology Inc.
RN4870/71 BLUETOOTH
LOW ENERGY MODULE
USER’S GUIDE

Preface

NOTICE TO CUSTOMERS
All documentation becomes dated, and this manual is no exception. Microchip tools and documentation are constantly evolving to meet customer needs, so some actual dialogs and/or tool descriptions may differ from those in this document. Please refer to our website (www.microchip.com) to obtain the latest documentation available.
Documents are identified with a “DS” number. This number is located on the bottom of each page, in front of the page number. The numbering convention for the DS number is “DSXXXXXXXXA”, where “XXXXXXXX” is the document number and “A” is the revision level of the document.
For the most up-to-date information on development tools, see the MPLAB Select the Help menu, and then Topics to open a list of available online help files.
®
IDE online help.
®
INTRODUCTION
This chapter contains general information that will be useful to know before using the RN4870/71 Bluetooth
• Document Layout
• Conventions Used in this Guide
• Recommended Reading
• The Microchip Website
• Development Systems Customer Change Notification Service
• Customer Support
• Document Revision History
DOCUMENT LAYOUT
This document describes how to use the RN4870/71 Bluetooth® Low Energy Module as a development tool to emulate and debug firmware on a target board. The document is organized as follows:
• Chapter 1. “Overview” – This chapter introduces the RN4870/71 Bluetooth Low
Energy Module and provides a brief overview of its various features.
• Chapter 2. “Command Reference” – This chapter provides information on the
commands used to configure the RN4870/71 Bluetooth Low Energy Module with examples.
• Chapter 3. “Embedded Scripting Feature” – This chapter provides the details
of the RN4870/71 Embedded Scripting feature.
• Chapter 4. “Connection Examples” – This chapter provides the steps on how to
establish a connection to RN4870/71 using SmartDiscover, SmartData, and a BLE device.
®
Low Energy Module. Items discussed in this chapter include:
2016 Microchip Technology Inc. DS50002466A-page 7
RN4870/71 Bluetooth® Low Energy Module User’s Guide
• Appendix A. “Bluetooth Low Energy Fundamentals” – This appendix pro-
vides the Bluetooth Low Energy Fundamentals.
• Appendix B. “Status Response Summary Quick Reference” – This appendix
provides a quick reference of all the status messages returned by RN4870 and summarizes the ASCII commands.
CONVENTIONS USED IN THIS GUIDE
This manual uses the following documentation conventions:
DOCUMENTATION CONVENTIONS
Description Represents Examples
Arial font:
Italic characters Referenced books MPLAB® IDE User’s Guide
Emphasized text ...is the only compiler...
Initial caps A window the Output window
A dialog the Settings dialog A menu selection select Enable Programmer
Quotes A field name in a window or
dialog
Underlined, italic text with right angle bracket
Bold characters A dialog button Click OK
N‘Rnnnn A number in verilog format,
Text in angle brackets < > A key on the keyboard Press <Enter>, <F1>
Courier New font:
Plain Courier New Sample source code #define START
Italic Courier New A variable argument file.o, where file can be
Square brackets [ ] Optional arguments mcc18 [options] file
Curly brackets and pipe character: { | }
Ellipses... Replaces repeated text
A menu path File>Save
A tab Click the Power tab
where N is the total number of digits, R is the radix and n is a digit.
Filenames autoexec.bat File paths c:\mcc18\h Keywords _asm, _endasm, static Command-line options -Opa+, -Opa- Bit values 0, 1 Constants 0xFF, ‘A’
Choice of mutually exclusive arguments; an OR selection
Represents code supplied by user
“Save project before build”
4‘b0010, 2‘hF1
any valid filename
[options]
errorlevel {0|1}
var_name [, var_name...]
void main (void) { ... }
DS50002466A-page 8  2016 Microchip Technology Inc.
RECOMMENDED READING
This user's guide describes how to use RN4870/71 Bluetooth® Low Energy Module. Other useful document(s) are listed below. The following Microchip document(s) are recommended as supplemental reference resources.
RN4870/71 Bluetooth
This document provides the technical specifications for the RN4870/71 module and is available for download from the Microchip website (www.microchip.com)
THE MICROCHIP WEBSITE
Microchip provides online support via our website at www.microchip.com. This website is used as a means to make files and information easily available to customers. Acces­sible by using your favorite Internet browser, the website contains the following infor­mation:
Product Support – Data sheets and errata, application notes and sample programs, design resources, user’s guides and hardware support documents, latest software releases and archived software
General Technical Support – Frequently Asked Questions (FAQs), technical support requests, online discussion groups, Microchip consultant program member listing
Business of Microchip – Product selector and ordering guides, latest Microchip press releases, listing of seminars and events; and listings of Microchip sales offices, distributors and factory representatives
Preface
®
4.2 Low Energy Module Data Sheet (DS50002489A)
DEVELOPMENT SYSTEMS CUSTOMER CHANGE NOTIFICATION SERVICE
Microchip’s customer notification service helps keep customers current on Microchip products. Subscribers will receive e-mail notification whenever there are changes, updates, revisions or errata related to a specified product family or development tool of interest.
To register, access the Microchip website at www.microchip.com, click on Customer The Development Systems product group categories are:
Compilers – The latest information on Microchip C compilers and other language tools
Emulators – The latest information on the Microchip MPLAB in-circuit emulator
In-Circuit Debuggers – The latest information on the Microchip in-circuit debugger, MPLAB ICD 3
MPLAB X IDE – The latest information on Microchip MPLAB X IDE, the Windows
Programmers – The latest information on Microchip programmers including the PICkit™ 3 development programmer
®
Integrated Development Environment for development systems tools
®
REAL ICE™
2016 Microchip Technology Inc. DS50002466A-page 9
RN4870/71 Bluetooth® Low Energy Module User’s Guide
CUSTOMER SUPPORT
Users of Microchip products can receive assistance through several channels:
• Distributor or Representative
• Local Sales Office
• Field Application Engineer (FAE)
• Technical Support
Customers should contact their distributor, representative or field application engineer (FAE) for support. Local sales offices are also available to help customers. A listing of sales offices and locations is included in the back of this document.
Technical support is available through the website at:
http://www.microchip.com/support.
DOCUMENT REVISION HISTORY
Revision A (April 2016)
This is the initial release of this document.
DS50002466A-page 10  2016 Microchip Technology Inc.

1.1 INTRODUCTION

Microchip’s RN4870/71 Bluetooth® Low Energy Module is a fully certified Bluetooth Smart module offering Bluetooth 4.2 connectivity in compact form factor. With all of its advanced features, it allows the Bluetooth Low Energy connectivity to be included in designs with minimal engineering.
The RN4870/71 module uses Microchip's IS1870 Bluetooth Low Energy RF IC. The primary difference between RN4870/71 firmware and the IS1870S factory firmware is that the RN4870/71 provides the control interface based on ASCII commands sent over UART. The ASCII command interface on the RN4870/71 is very similar to that of RN41/42/52/4020/4677, providing an easy migration path for customers currently using the RN modules.
Interactive ASCII commands enable the RN4870/71 to be configured without complex configuration tools. The RN4870/71 supports both peripheral and central Generic Access Profile (GAP) roles, actively scanning for other connectable devices instead of waiting for incoming connection requests.
RN4870/71 BLUETOOTH
LOW ENERGY MODULE

Chapter 1. Overview

®
USER’S GUIDE

1.2 KEY FEATURES

The RN4870/71 Bluetooth Low Energy Module has the following key features:
1.2.1
The RN4870/71 is controlled primarily through ASCII commands sent from host MCU to UART. The ASCII commands can control functions such as connection setup/teardown, accessing Generic Attribute Profile (GATT) characteristics, changing configuration settings, and reading status. The UART can operate in Command mode, to receive ASCII commands, or Data mode to exchange data using “Transparent UART” Bluetooth service.
1.2.2
The RN4870/71 introduces a private GATT service named as “Transparent UART”. This service simplifies serial data transfers over Bluetooth Low Energy (BTLE) devices. RN4870/71 Transparent UART seamlessly transfer serial data from its UART over a Bluetooth Low Energy connection, providing an end-to-end data pipe to another Blue­tooth device such as RN4870/71 module or Smartphone.
1.2.3
The RN4870/71 has the capability to define up to five public and four private custom defined GATT services. Each custom service allows up to eight characteristics. All service definitions are saved in on-board Non-Volatile Memory (NVM) configuration settings.

ASCII Command Interface

Transparent UART

Custom GATT Services

2016 Microchip Technology Inc. DS50002466A-page 11
RN4870/71 Bluetooth® Low Energy Module User’s Guide
Server
x iOS x Android x RN4870 x PC

1.2.4 Embedded Scripting Feature

RN4870/71 supports script functionality. The script capability is unique to Microchip RN modules that enables the user to write ASCII based script into RN4870/71 NVM and automatically execute the application logic through the script. The script capability enables RN4870/71 to run relatively simple operations without a host MCU.
1.2.5

Remote Command Console

RN4870/71 supports Remote Command mode which allows a remote device to access Command mode remotely via Bluetooth link. This feature requires UART Transparent function to be enabled first.

1.3 COMMAND MODE AND DATA MODE

The RN4870/71 operates in two modes: Data mode (default) and Command mode. When RN4870/71 is connected to another BLE device and is in Data mode, the RN4870/71 acts as a data pipe: any serial data sent into RN4870/71 UART is trans­ferred to the connected peer device via Transparent UART Bluetooth service. When data is received from the peer device over the air via Transparent UART connection, this data outputs directly to UART.
For configuration or control operation, or both, set the RN4870/71 into Command mode. In Command mode, all UART data is treated as ASCII commands sent to the module's UART interface.
As illustrated in Figure 1-1, the RN4870/71 can enter and exit Command and Data mode using ASCII command over UART or over configurable PIO.
To enter Command mode from Data mode, type $$$ character sequence after 100 ms delay before the first $. A CMD> prompt is sent to UART to notify the external host of the start of the Command mode. The Data mode escape character can change from $ to another character using S$ command.
To return to Data mode, enter command --- at the command prompt. The END mes­sage displays indicating the end of command console session.
In addition to using ASCII Command mode escape character and the command --- to enter/exit Command mode, it is possible to configure a PIO to do the same. This method is more suitable for applications where there is a need for the host MCU to enter and exit the Command mode.

FIGURE 1-1: COMMAND MODE AND TRANSPARENT UART (DATA) MODE

RN4870
---/PIO
HOST
MCU
DS50002466A-page 12  2016 Microchip Technology Inc.
UART
PIO
$$$/PIO
GATT
GATT/Transparent UART
CMD>
BTLE Device

1.4 ACCESSING THE RN4870/71 OVER UART

The most common application for the host MCU to control the RN4870/71 is via ASCII commands. For development and prototyping purposes, using a terminal emulator to send commands and data over UART is recommended. Any terminal emulator, such as TeraTerm (Windows figure the RN4870/71 via UART on host PC.
With the RN4870/71 connected to a computer and a serial port enumerated for the UART port, run the terminal emulator to open the COM port using the port settings defined in Tab le 1 -1 .

TABLE 1-1: DEFAULT UART SETTINGS

UART Setting Default value
Baud Rate 115200
Data Bits 8
Stop Bits 1
Flow Control Disabled
To enter Command mode, type $$$ into the terminal emulator. Once RN4870/71 enters Command mode, the string CMD> is sent by the module via the UART to indicate the start of Command mode session.
Once in Command mode, valid ASCII commands can be issued to control or configure the RN4870/71. All commands end with a carriage return <cr> and are always responded to by the RN4870/71. Any subsequent command must not be issued until a response is received for the previous command.
For Set or Action commands, AOK indicates a positive or successful response while ERR indicates an error or negative response. By default, when the RN4870/71 is ready to receive the next command, the command prompt CMD> is sent to UART.
To return to Data mode, type ---<cr>. The RN4870/71 automatically enters Data mode once connected or disconnected with another device, if UART Transparent fea­ture is enabled.
®
) or CoolTerm (Mac OS-X®), can be used to control and con-
Parity None
Note: The module supports Fast Data mode. In this mode, the module does not
enter Command mode even if it receives $$$. To enable Fast Data mode, use command SR.

1.5 RN4870 PIO CONTROL LINES

RN4870/71 shares the same General Purpose Input Output (GPIO) control interface with IS1870S. Up to 12 GPIO pins are configurable to perform various functionalities through IS1870S UI tool. The RN4870/71 is compatible with any IS1870S tool and allows user configurations. For more information, refer to “RN4870/71 Bluetooth
Low Energy Module Data Sheet” (DS50002489A) and “IS1870/71 Bluetooth Energy (BLE) SoC Data Sheet” (DS60001371).
2016 Microchip Technology Inc. DS50002466A-page 13
®
Low
®
4.2
RN4870/71 Bluetooth® Low Energy Module User’s Guide
NOTES:
DS50002466A-page 14  2016 Microchip Technology Inc.

Chapter 2. Command Reference

2.1 INTRODUCTION

The RN4870/71 supports a variety of UART commands for controlling and configura­tion. This chapter describes these commands in detail and provides examples.

2.2 COMMAND SYNTAX

The ASCII command syntax is a keyword followed by optional parameters.
• ASCII commands are divided into multiple groups:
- Set Commands
- Get Commands
- Action Commands
- List Commands
- Service Configuration Commands
- Characteristic Access Commands
- Script Commands
• All commands contain one, two or three case-insensitive characters
• Delimit command and any argument with a comma
• Text data is case sensitive such as Bluetooth name
• All commands end with carriage return ('\r', \x0d)
• Get commands return the value requested by the corresponding command to be retrieved. Most of the other commands return either AOK (<AOK><CR>) that indi­cates a positive response or ERR (<ERR><CR>), as a negative response.
All configuration changes made by Set commands are stored in the Non-Volatile Mem­ory (NVM) and survive the power cycle. Any configuration changes takes effect after a reboot.
For a list of all commands, refer to Tab le B- 2 in Appendix B. “Status Response
Summary Quick Reference”.
RN4870/71 BLUETOOTH
LOW ENERGY MODULE
USER’S GUIDE
®

2.3 SET AND GET COMMANDS

Set and Get commands are used to configure features and functions of the RN4870/71 module. The format of the Set and Get commands are provided in Tab l e 2 -1 . The Set command starts with character “S” and followed by one or two character configuration identifier. All Set commands take at least one parameter that is separated from the command by a comma. Set commands change configurations and take effect after rebooting either via R,1 command, hard Reset, or power cycle.
2016 Microchip Technology Inc. DS50002466A-page 15
RN4870/71 Bluetooth® Low Energy Module User’s Guide
Most Set commands have a corresponding Get command to retrieve and output the current configurations via the UART. Get commands have the same command identifiers as Set commands but without parameters.

TABLE 2-1: SET AND GET COMMANDS SYNTAX FORMAT

Command
Type
S Command Identifier , Input Parameter <CR> SN,DeviceName // Set device name G Command Identifier <CR> GN // Get device name
Command ID Delimiter Parameter(s)

2.4 SET COMMANDS

2.4.1 S-,<string>

This command sets a serialized Bluetooth name for the device, where <string> is up to 15 alphanumeric characters. This command automatically appends the last two bytes of the Bluetooth MAC address to the name which is useful for generating a custom name with unique numbering.This command does not have corresponding get com­mand.
Default: N/A Example: S-,MyDevice // Set device name to “MyDevice_XXXX”
Response: AOK
ERR
// Success // Syntax error or invalid parameter
End of
Command
Example
2.4.2

S$,<char>

This command sets the Command mode character, where <char> is a single character in the three character pattern. This setting enables the user to change the default char­acter to enter Command mode ($$$) to another character string. Restoring the factory defaults returns the device to use $$$.
Default: $ Example: S$,# // Set ### as string to enter Command mode
Response: AOK
ERR
2.4.3

S%,<pre>,<post>

// Success // Syntax error or invalid parameter
This command sets the pre and post delimiter of the status string from RN4870/71 to the host controller. The pre and post delimiter are up to four printable ASCII characters. If no parameter is given to the post delimiter, then the post delimiter is cleared; if no parameter is given to the pre-delimiter, then both pre and post delimiters are cleared.
Default: % Example: S%,<$,#> // Set pre delimiter to <$ and post delimiter to #>
// When the output status string is Reboot instead // of %REBOOT%, the output is <$REBOOT#>
Response: AOK
ERR
// Success // Syntax error or invalid parameter
DS50002466A-page 16  2016 Microchip Technology Inc.

2.4.4 S:,<H16>,<Hex>

This command is used to change any settings in configuration NVM.
This command expects two parameters. The first parameter is a 16-bit hex value that represents memory address of eFlash of the first byte of data. If more than one byte of data is provided, the memory address automatically increases. The second parameter is the data value in HEX format, up to 32 bytes.
CAUTION
This command must be used with caution to avoid corrupting the NVM configuration settings. Consult the Microchip Representatives for detailed memory layout of NVM configuration settings.
Default: N/A Example: S:,0006,41424300 // Set device name to be ABC, where device
// name is stored in eFlash starting from // memory shift address 0x0006
Response: AOK
ERR
// Success // Syntax error or invalid parameter
2.4.5

SA,<1-3>

The Set Authentication command sets RN4870/71 Input/Output (I/O) capability which decides authentication method to be used when securing BLE link. The parameters are described in Tab le 2- 2.
Once a remote device exchanges pin codes with the RN4870/71 device, a link key is stored for future use. The device automatically and permanently stores up to eight peer devices in flash memory.
TABLE 2-2: SET I/O CAPABILITY
Value Description
1 Display Yes/No. If authentication is enabled, RN4870/71 must display the pin code
to enable remote peer device to input the same pin code.
2 No I/O Capability. This mode works without request to display or input any security
pin.
3 Keyboard I/O. If authentication is enabled, RN4870/71 must input the pin code that
displays on the remote peer device.
Default: 2 Example: SA,1 // Set device to be able to display pin
Response: AOK
ERR
// Success // Syntax error or invalid parameter
2016 Microchip Technology Inc. DS50002466A-page 17
RN4870/71 Bluetooth® Low Energy Module User’s Guide

2.4.6 SB,<H8>

This command sets the baud rate of the UART communication. The input parameter is an 8-bit hex value in the range of 00 to 0B, representing baud rate from 2400 to 921K, as shown in Ta bl e 2 -3 .
TABLE 2-3: UART BAUD RATE SETTINGS
Setting Baud Rate
00 921600 01 460800 02 230400 03 115200 04 57600 05 38400 06 28800 07 19200 08 14400 09 9600 0A 4800 0B 2400
Default: 03 Example: SB,07 // Set the UART baud rate to be 19200
Response: AOK
ERR
2.4.7

SC,<0-2>

// Success // Syntax error or invalid parameter
This command configures the beacon feature. It expects one single digit input param­eter as described in Ta bl e 2 - 4.
TABLE 2-4: BEACON MODE SETTINGS
Setting Beacon Mode
0 Beacon feature is disabled 1 Beacon feature is enabled; connectable advertisement is dis-
abled
2 Non-connectable beacon and connectable advertisement are
both enabled.
Refer to commands IB (2.6.20) and NB (2.6.21) to configure beacon payload.
Default: 0 Example: SC,2 // Enable both beacon and advertisement
Response: AOK
ERR
// Success // Syntax error or invalid parameter
DS50002466A-page 18  2016 Microchip Technology Inc.

2.4.8 SDA,<H16>

This command sets the appearance of RN4870/71 in GAP service. It expects one 16-bit hex input parameter. Bluetooth SIG defines the appearance code for different devices. Please refer to Bluetooth SIG web site for details (https://www.bluetooth.org/en-us).
Default: 0000 Example: SDA,0340 // Set appearance to be Generic Heart Rate Sensor
2.4.9
This command sets the value of firmware revision characteristic in the Device Informa­tion Service. This command is only effective if the Device Information service is enabled by command SS.
Device Information Service is used to identify the device. All its characteristics rarely change. Therefore, values of characteristics in Device Information Service can be set and saved into NVM. All values of characteristic in Device Information Service have the maximum size of 20 bytes. For more information on Device Information Service visit
https://developer.bluetooth.org/TechnologyOverview/Pages/DIS.aspx and https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.blue­tooth.service.device_information.xml
Default: Current RN4870 firmware version
Example: SDF,0.9
Response: AOK
2.4.10
This command sets the value of the hardware revision characteristics in the Device Information Service. This command is only effective if the Device Information service is enabled by command SS.

SDF,<text>

ERR

SDH,<text>

// Success // Device Info service not enabled. // Syntax error, invalid parameter
Default: Current hardware version
Example: SDH,2.1
Response: AOK
ERR
2.4.11
This command sets the model name characteristics in the Device Information Service. This command is only effective if the Device Information service is enabled by command SS.
Default: RN_BLE
Example: SDM,RN4870
Response: AOK
2016 Microchip Technology Inc. DS50002466A-page 19

SDM,<text>

ERR
// Success // Device Info service not enabled. // Syntax error, invalid parameter
// Success // Device Info service not enabled. // Syntax error, invalid parameter
RN4870/71 Bluetooth® Low Energy Module User’s Guide

2.4.12 SDN,<text>

This command sets the manufacturer name characteristics in the Device Information Service. This command is only effective if the Device Information service is enabled by command SS.
Default: Microchip
Example: SDN,Microchip
Response: AOK
ERR
// Success // Device Info service not enabled. // Syntax error, invalid parameter
2.4.13
This command sets software revision in the Device Information Service. This command is only effective if the Device Information service is enabled by command SS.
Default: Current Software Revision
Example: SDR,1.0
Response: AOK
2.4.14
This command sets the value of serial number characteristics in the Device Information Service. This command is only effective if the Device Information service is enabled by command SS.
Default: N/A
Example: SDS,12345678
Response: AOK
2.4.15

SDR,<text>

ERR

SDS,<text>

ERR

SF,1

// Success // Device Info service not enabled. // Syntax error, invalid parameter
// Success // Device Info service not enabled. // Syntax error, invalid parameter
This command resets the configurations into factory default. The first parameter must be 1.
Example: SF,1
Response: Reboot after Factory Reset
ERR
Note: This command causes an immediate reboot after invoking it.
DS50002466A-page 20  2016 Microchip Technology Inc.
// Reboot // Syntax error or invalid parameter
Loading...
+ 45 hidden pages