User Guide RN4020 (Microchip) - 10

ManufacturerMicrochip
DescriptionBluetooth Low Energy Module
Pages / Page104 / 10 — RN4020 Bluetooth Low Energy Module User’s Guide. THE MICROCHIP WEB SITE. …
File Format / SizePDF / 945 Kb
Document LanguageEnglish

RN4020 Bluetooth Low Energy Module User’s Guide. THE MICROCHIP WEB SITE. Product Support. General Technical Support

RN4020 Bluetooth Low Energy Module User’s Guide THE MICROCHIP WEB SITE Product Support General Technical Support

Model Line for this Datasheet

Text Version of Document

RN4020 Bluetooth Low Energy Module User’s Guide THE MICROCHIP WEB SITE
Microchip provides online support via our web site at: http://www.microchip.com. This web site makes files and information easily available to customers. Accessible by most Internet browsers, the web site contains the following information: •
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 listings •
Business of Microchip
– Product selector and ordering guides, latest Microchip press releases, listings of seminars and events; and listings of Microchip sales offices, distributors and factory representatives
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 web site at www.microchip.com, click on Customer Change Notification and follow the registration instructions. 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 in-circuit emulator, MPLAB® REAL ICE™ •
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® Integrated Development Environment for development systems tools •
Programmers
– The latest information on Microchip programmers including the PICkit™ 3 development programmer
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 web site at: http://support.microchip.com DS70005191B-page 10  2014 Microchip Technology Inc. Document Outline Preface Introduction Document Layout Conventions Used in this Guide Recommended Reading The Microchip Web Site Development Systems Customer Change Notification Service Customer Support Document Revision History Chapter 1. Introduction 1.1 Bluetooth Low Energy Fundamentals Table 1-1: Characteristic Properties Chapter 2. RN4020 Command Interface 2.1 RN4020 Control Lines Figure 2-1: RN4020 Module Pin Diagram Table 2-1: RN4020 Module Pin Description 2.2 GAP Role Switching Table 2-2: Role Switch Commands 2.3 RN4020 UART-ASCII Command and Responses Table 2-3: RN4020 UART Configuration Table 2-4: Command Descriptions 2.3.1 Set/Get Commands Example 2-1: Set Command Format Table 2-5: UART Baud Rate Settings Table 2-6: SP Level/TX Power Out Table 2-7: Bitmap Features Table 2-8: Bitmap Services Table 2-9: Connection Parameters 2.3.2 Action Commands Table 2-10: Bitmap of “|O” and “|I” Commands 2.3.3 I2C™ Commands Table 2-11: I2C™ Commands 2.3.3.1 Enable I2C 2.3.3.2 Disable I2C 2.3.3.3 I2C EEPROM Access 2.3.3.4 I2C Basic Operations Table 2-12: I2C™ Events 2.3.3.5 Example of Accessing the Microchip I2C EEPROM 24LC512 Figure 2-2: Writing Data via the I2C™ Interface Figure 2-3: Reading Data via the I2C™ Interface 2.3.4 PWM Commands Figure 2-4: PWM Waveform Table 2-13: PWM Parameters 2.3.5 Characteristic Access Commands 2.3.5.1 Definition of Characteristic Access Commands Example 2-2: Listing Client Service and Characteristics 2.3.6 Private Service Configuration Commands Table 2-14: Security flags of characteristic 2.3.7 Microchip MLDP Commands 2.3.7.1 Microchip Low-Energy Data Profile (MLDP) 2.3.7.2 MLDPv2 2.3.8 RN4020 Scripting Commands 2.3.8.1 RN4020 Scripting Capabilities 2.3.8.2 Event Driven Table 2-15: List of Events and Event Labels 2.3.8.3 Comments 2.3.8.4 Variables 2.3.8.5 Remote Function Call Example 2-3: Function Example 2.3.9 RN4020 Script Commands Table 2-16: “WR” Command Input Parameters and Associated Events 2.3.10 Remote Command 2.4 Summary of RN4020 UART Outputs 2.4.1 ASCII Commands with Non-Standard Response Table 2-17: Non-Standard Response for ASCII Commands 2.4.2 UART Response to PIO Switches Table 2-18: UART Response to PIO Events 2.4.3 UART Notifications Table 2-19: UART Notification 2.5 Device Firmware Upgrade 2.5.1 DFU Commands Chapter 3. Application Examples 3.1 Demonstration with a Smart Device 3.1.1 Setup 3.1.2 Running the Demonstration Figure 3-1: Discovering the RN4020 Module Figure 3-2: Reading the Model Number String From the Device Information Service Figure 3-3: Reading Battery Level in Battery Service Figure 3-4: Notification Result of Battery Level Example 3-1: User-Defined Private Services Figure 3-5: Private Services Discovered After Power Cycle Figure 3-6: Reading the Private Characteristic Figure 3-7: Writing Values to Private Characteristics Figure 3-8: Notification to Private Characteristic 3.2 Connecting Two RN4020 Modules 3.2.1 Configure the First Device (Module A) 3.2.2 Configure the Second Device (Module B) 3.2.3 Connecting the Two Devices 3.2.4 Checking Server and Client Services Table 3-1: Module A Server and Client Services Table 3-2: Module B Server and Client Services 3.2.5 Setting the Battery Service 3.3 MLDP Demonstration 3.4 RN4020 Scripting Demonstration 3.4.1 Setting Up Private Service and Characteristics 3.4.2 Script Input 3.4.3 Running the Script Appendix A. PICtail™ Daughter Board Schematics Figure A-1: RN4020 Module Figure A-2: PIC18LF25K50-I/ML Device Figure A-3: 28-pin and 30-pin PICtail™ Connectors Figure A-4: RN4020 Module Breakout Pins Figure A-5: Status LEDs Figure A-6: Voltage Regulator Figure A-7: Decoupling Capacitor for the PIC18LF25K50-I/ML Device Figure A-8: Test Switch Figure A-9: ICSP™ Connector Corporate Office Atlanta Austin, TX Boston Chicago Cleveland Fax: 216-447-0643 Dallas Detroit Houston, TX Indianapolis New York, NY San Jose, CA Canada - Toronto Fax: 852-2401-3431 Australia - Sydney China - Beijing China - Shanghai India - Bangalore Korea - Daegu Korea - Seoul Singapore Taiwan - Taipei Fax: 43-7242-2244-393 Denmark - Copenhagen France - Paris Germany - Dusseldorf Germany - Pforzheim Italy - Milan Italy - Venice Spain - Madrid Worldwide Sales and Service