BM77 PICtail/PICtail Plus Board User's Guide

BM77 PICtail™/PICtail Plus Board
User’s Guide
 2015 Microchip Technology Inc.
DS50002409A
Note the following details of the code protection feature on Microchip devices:
•
Microchip products meet the specification contained in their particular Microchip Data Sheet.
•
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
•
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.
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC,
FlashFlex, flexPWR, JukeBlox, KEELOQ, KEELOQ logo, Kleer,
LANCheck, 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.
The Embedded Control Solutions Company and mTouch are
registered trademarks of Microchip Technology Incorporated
in the U.S.A.
Analog-for-the-Digital Age, BodyCom, chipKIT, chipKIT logo,
CodeGuard, dsPICDEM, dsPICDEM.net, ECAN, In-Circuit
Serial Programming, ICSP, Inter-Chip Connectivity, KleerNet,
KleerNet logo, MiWi, MPASM, MPF, MPLAB Certified logo,
MPLIB, MPLINK, MultiTRAK, NetDetach, Omniscient Code
Generation, PICDEM, PICDEM.net, PICkit, PICtail,
RightTouch logo, REAL ICE, SQI, Serial Quad I/O, 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 trademark 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.
© 2015, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
ISBN: 978-1-63277-717-1
QUALITYMANAGEMENTSYSTEM
CERTIFIEDBYDNV
== ISO/TS16949==
DS50002409A-page 2
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® MCUs and dsPIC® DSCs, KEELOQ® code hopping
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.
 2015 Microchip Technology Inc.
Object of Declaration: BM77 PICtail™/PICtail Plus Board
 2015 Microchip Technology Inc.
DS50002409A-page 3
BM77 PICtail™/PICtail Plus Board
NOTES:
DS50002409A-page 4
 2015 Microchip Technology Inc.
BM77 PICtail™/PICtail PLUS BOARD
USER’S GUIDE
Table of Contents
Preface ........................................................................................................................... 7
Chapter 1. Overview
1.1 Introduction ................................................................................................... 11
1.2 BM77 PICtail™ Board Description ............................................................... 11
1.3 Board Features ............................................................................................. 12
1.4 Interface Description .................................................................................... 13
1.5 USB-UART Serial Interface .......................................................................... 14
1.6 PICtail Plus and PICtail Interface ................................................................. 15
Chapter 2. Getting Started
2.1 Introduction ................................................................................................... 17
2.2 Hardware Requirements .............................................................................. 17
2.3 Software Requirements ................................................................................ 17
2.4 Using BM77 PICtail Board in USB-UART Serial Interface Mode ................. 17
2.5 Using BM77 PICtail Board in PICtail Interface Mode ................................... 33
Appendix A. BM77 Module PIN Assignment
A.1 BM77 Module PIN Assignment .................................................................... 45
Appendix B. Schematics
B.1 BM77 PICtail™/PICtail Plus Board Schematics ........................................... 47
Appendix C. Questions and Answers
C.1 Questions and Answers ............................................................................... 49
Worldwide Sales and Service .................................................................................... 50
 2015 Microchip Technology Inc.
DS50002409A-page 5
BM77 PICtail™/PICtail Plus Board User’s Guide
NOTES:
DS50002409A-page 6
 2015 Microchip Technology Inc.
BM77 PICtail™/PICtail PLUS BOARD
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® IDE online help.
Select the Help menu, and then Topics to open a list of available online help files.
INTRODUCTION
This chapter contains general information that will be useful to know before using the
BM77 PICtail™/PICtail Plus Board. Items discussed in this chapter include:
•
•
•
•
•
•
•
Document Layout
Conventions Used in this Guide
Recommended Reading
The Microchip Website
Development Systems Customer Change Notification Service
Customer Support
Revision History
DOCUMENT LAYOUT
This document describes how the BM77 PICtail/PICtail Plus Board enables the
designer to evaluate and demonstrate the capabilities of the BM77 Dual Mode Bluetooth® RF Module. The document is organized as follows:
• Chapter 1. “Overview”– This chapter describes the BM77 PICtail/PICtail Plus
Board.
• Chapter 2. “Getting Started” – This chapter describes how to establish
Bluetooth serial data connections using the BM77 PICtail Board, demonstrates
how serial data is transmitted from the BM77 PICtail Board (via PC Chat) to an
iOS device using Bluetooth Low Energy (BLE) connection, and provides an
overview on how to configure the BM77 module on the BM77 PICtail/PICtail Plus
Board using a PIC® MCU through the PICtail interface.
• Appendix A. “BM77 Module PIN Assignment” - This appendix shows the pinout for BM77 and describes the pins of the module.
• Appendix B. “Schematics” - This appendix shows the BM77 PICtail/PICtail Plus
Board schematics.
• Appendix C. “Questions and Answers” - This appendix lists the most common
questions and answers when using the BM77 module.
 2015 Microchip Technology Inc.
DS50002409A-page 7
BM77 PICtail™/PICtail Plus Board User’s Guide
CONVENTIONS USED IN THIS GUIDE
This manual uses the following documentation conventions:
DOCUMENTATION CONVENTIONS
Description
Italic characters
Initial caps
Examples
Referenced books
MPLAB® IDE User’s Guide
Emphasized text
...is the only compiler...
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
“Save project before build”
Underlined, italic text with
right angle bracket
A menu path
File > Save
Bold characters
A dialog button
Click OK
A tab
Click the Power tab
Text in angle brackets < >
A key on the keyboard
Press <Enter>, <F1>
Plain Courier New
Sample source code
#define START
Filenames
autoexec.bat
File paths
c:\mcc18\h
Keywords
_asm, _endasm, static
Command-line options
-Opa+, -Opa-
Bit values
0, 1
Constants
0xFF, ‘A’
Italic Courier New
A variable argument
file.o, where file can be any
valid filename
Square brackets [ ]
Optional arguments
mcc18 [options] file
[options]
Curly brackets and pipe
character: { | }
Choice of mutually exclusive
arguments; an OR selection
errorlevel {0|1}
Ellipses...
Replaces repeated text
var_name [, var_name...]
Represents code supplied by
user
void main (void)
{ ...
}
Notes
DS50002409A-page 8
Represents
A Note presents information
that we want to re-emphasize,
either to help you avoid a
common pitfall or to make you
aware of operating differences
between some device family
members. A Note can be in a
box, or when used in a table
or figure, it is located at the
bottom of the table or figure.
Note:
This is a standard
note box.
CAUTION
This is a caution note.
Note 1: This is a note used in a
table.
 2015 Microchip Technology Inc.
Preface
RECOMMENDED READING
This user's guide describes how to use BM77 PICtail/PICtail Plus Board. Other useful
documents are listed below. The following Microchip document(s) are recommended
as supplemental reference resources:
BM77SPPx3MC2 Bluetooth® 4.0 Dual Mode Module Data Sheet
This document provides the technical specifications for the BM77 module and is
available for download from the Microchip website at 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. Accessible by using your favorite Internet browser, the website 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 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
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® REAL ICE™
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® Integrated Development Environment for development systems tools
• Programmers – The latest information on Microchip programmers including the
PICkit™ 3 development programmer
 2015 Microchip Technology Inc.
DS50002409A-page 9
BM77 PICtail™/PICtail Plus Board 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.
REVISION HISTORY
Revision A (August 2015)
This is the initial release of this document.
DS50002409A-page 10
 2015 Microchip Technology Inc.
BM77 PICtail™/PICtail PLUS BOARD
USER’S GUIDE
Chapter 1. Overview
1.1
INTRODUCTION
This document describes the hardware and software for the BM77 PICtail™/PICtail
Plus Board.
The BM77 PICtail/PICtail Plus Board enables the designer to evaluate and
demonstrate the capabilities of the BM77 Dual Mode Bluetooth® RF Module. The
evaluation board includes an integrated configuration and programming interface for
plug-and-play capability. It also includes on-board connection and data-status LEDs
enabling rapid prototyping and fast time to market.
In addition to BM77 PICtail/PICtail Plus Board hardware, several software applications
are provided to demonstrate Bluetooth data connections to the on-board BM77 module
and optionally configure the BM77 module.
The demonstration software application consists of the following SmartPhone APPS:
• Android™ Chat Application using Serial Port Profile (SPP)
• iOS Bluetooth Terminal (BLETR)
• BT Chat Tool
The configuration software consists of the following components:
• BM77 Configuration Library
• BM77 Configuration User Interface (UI) Tool
• BM77 Electrically-Erasable Programmable Read-Only Memory (EEPROM) Table
Utility
1.2
BM77 PICtail™ BOARD DESCRIPTION
The BM77 PICtail™ Board provides rapid prototyping and developing for Bluetooth
data applications for Classic SPP or Bluetooth Low Energy. Refer to Figure 1-1. It can
be powered via USB host or through the Microchip PICtail Plus interface. The BM77
PICtail Board utilizes the BM77 module, a fully certified Bluetooth 4.0 dual mode RF
module supporting Bluetooth Classic SPP and Bluetooth Low Energy (BTLE),
providing Bluetooth serial data connections. The BM77 PICtail Board provides a
MCP2200 USB-UART converter for issuing commands to control or configure the
BM77 modules for any specific requirement based on the application. The USB-UART
converter provides the flexibility to interface to a host PC, a PC terminal utility to drive
both classic SPP and BTLE data connections. The BM77 PICtail Board also provides
Microchip PICtail Plus and PICtail interfaces to interface with the Microchip PIC®
microcontrollers (MCU) using Microchip development tools such as the Explorer 16
Development Board (DM240001) or the PIC18 Explorer Board (DM183032).
 2015 Microchip Technology Inc.
DS50002409A-page 11
BM77 PICtail™/PICtail Plus Board User’s Guide
FIGURE 1-1:
1.3
BM77 PICtail™/PICtail PLUS BOARD
BOARD FEATURES
The BM77 PICtail board has the following features:
• Fully certified on-board Bluetooth 3.0 + EDR and Bluetooth 4.0 stack
• Class 2 transmitter, +2 dBm typical
• Transparent serial data connection over Bluetooth Classic SPP and Bluetooth
Low-Energy transparent serial data service
• Automatic configuration mode for quick setup (default)
• Manual configuration mode for the MCU to access the configuration settings
• Configuration settings stored in internal EEPROM on BM77
• On-board Dual In-line Package (DIP) switch block to set operating modes
• PICtail Plus and PICtail interfaces to fully access BM77 pins using the external
PIC MCU
• Embedded MCP2200 USB-UART converter to enable application mode and programming interface to update firmware and configuration settings
DS50002409A-page 12
 2015 Microchip Technology Inc.
1.4
INTERFACE DESCRIPTION
The following are the description of the BM77 PICtail board in its default configuration
as represented in Figure 1-2:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
Bluetooth Module, BM77 (FP1)
Button to SW_BTN pin (SW1); press the button down to turn ON BM77
Wake up button to wake up the module from shutdown state (SW2)
Reset button for BM77 Bluetooth module (SW3)
Mode Switch (SW4); refer to Table 1-1 and Table 1-2
PICtail interface; right angle pins (J1)
PICtail Plus interface; edge connector (J2)
Header that brings out BM77 pins (CN2)
I2C expansion port (CN4)
Microchip MCP2200 chip; USB/UART serial converter (U3)
Mini-B USB connector (P1)
Ground (GND) test points (JP1)
Status LED (D1)
FIGURE 1-2:
BM77 PICtail™/PICtail PLUS BOARD CONFIGURATION
10
( below)
2
1
13
8
11
3
4
5
9
12
6
7
 2015 Microchip Technology Inc.
DS50002409A-page 13
BM77 PICtail™/PICtail Plus Board User’s Guide
1.4.1
Mode Definition and Mode Switch Settings
Table 1-1 and Table 1-2 show the mode definitions and the mode switch settings of the
module.
TABLE 1-1:
Mode
MODE DEFINITIONS
Switch
Number
1
3
Pin Name P20
P24
EAN
ON
Low
Low
High
Function
EEPROM/Test mode
High = Disable/Application
Low = Enable/Test mode
Flash Write
High = Disable
Low = Enable
Boot to Flash or ROM
Application
High = ROM
Low = Flash
TABLE 1-2:
MODE SWITCH SETTINGS
Mode
1.5
2
Switch
PIN Definition
Write Flash
1 = P20: Low
2 = P24: Low
3 = EAN: High
EEPROM/Test
1 = P20: Low
2 = P24: High
3 = EAN: Low
Application
(default)
1 = P20: High
2 = P24: High
3 = EAN: Low
USB-UART SERIAL INTERFACE
The BM77 PICtail Board consists of an USB-UART converter enabling flexible interface
to the host PC, a PC terminal utility and Smartphone APPs to drive both classic SPP
and BTLE data connections. The Universal Asynchronous Receiver/Transmitter
(UART) port on the BM77 is exposed through an MCP2200 USB-UART serial converter
for interfacing easily with a host PC.
Connecting the mini-B USB receptacle (P1) on the BM77 PICtail Board to the USB port
on a PC enumerates the BM77 PICtail Board as a Composite Device Class (CDC) USB
device for serial communication. A dedicated COM port is assigned on the host PC for
serial communication with the BM77 on the BM77 PICtail Board after the MCP2200 is
enumerated. A PC terminal utility or application opens the assigned COM port and connects to the UART port on BM77 for serial data transfer or to configure and control
BM77. If the MCP2200 does not enumerate, ensure that the MCP2200 drivers are
downloaded and manually installed from www.microchip.com/MCP2200.
DS50002409A-page 14
 2015 Microchip Technology Inc.
1.6
PICtail PLUS AND PICtail INTERFACE
Using the PICtail Plus (J2) or PICtail (J1) interface, the board can be plugged into any
standard Microchip development board such as the Explorer 16 Development Board
(DM240001) or the PIC18 Explorer Board (DM183032) that supports the PICtail Plus
or PICtail connection interface.
The PICtail interface provides access to the UART port and the General Purpose Input
Output (GPIO) pins on the BM77 PICtail/PICtail Plus Board. The PICtail interface is
used to configure the BM77 by updating the Bluetooth parameters on the internal
EEPROM, updating the BM77 firmware on the internal flash, and entering BM77 into
application mode. In application mode, pairing procedure is performed on the BM77
after establishing a Bluetooth connection for SPP or BLE data transfer.
Figure 1-3 and Figure 1-4 show the pin mapping for the PICtail Plus 30-pin interface
and the PICtail 28-pin interface.
FIGURE 1-3:
PIN MAPPING FOR THE PICtail™ PLUS 30-PIN INTERFACE
P3_1
P3_4
P3_3
P3_2
SW_BTN
P2_4
EXT_3V3
C3
1u/16V
P0_4
BT_UART_RTS
P0_5
BT_RST_N
1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
RB2/SS1/AN2
RF2/U1RX_E
RF6/SCK1
RF3/U1TX_E
RF7/SDI1_E
RG2/SCL1
RF8/SDO1_E
RG3/SDA1
GND
GND
RB0/AN0
RB1/AN1
RB3/AN3
RB4/AN4
GND
GND
RE9/INT2
RE8/INT1
RD14/U1CTS_E RD15/U1RTS_E
3.3V
3.3V
5V
5V
9V
9V
RG0
RF0
RG1
RF1
J2
FIGURE 1-4:
SW_BTN
P2_4
BT_UART_TXD
BT_UART_RXD
P0_5
BT_WAKE_UP
P0_4
P1_5
BT_UART_CTS
BT_UART_TXD
BT_UART_RXD
P3_6
LED
P2_0
EAN
P1_5
BT_UART_CTS
P3_7
BT_WAKE_UP
PICWDLO PLUS 30 Pin
PIN MAPPING FOR THE PICtail™ 28-PIN INTERFACE
1
3
5
7
9
11
13
15
17
19
21
23
25
27
RE2
RE3
RA7/OSC1
RA6/OSC2
RC7
RC6
RB7
RB6
RB5
RB4
RB3
RB2
RB1
RB0
J1
 2015 Microchip Technology Inc.
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
RA5
RA4
RA3
RC5
RC4
RC3
RA0
RA1
RA2
RC0
RC1
RC2
V_VAR
GND
PICWDLO 28 Pin
2
4
6
8
10
12
14
16
18
20
22
24
26
28
P2_0
EAN
BT_UART_RTS
P3_2
P3_3
P3_4
P3_7
BT_RST_N
P3_1
EXT_3V3
C2
1u/16V
DS50002409A-page 15
BM77 PICtail™/PICtail Plus Board User’s Guide
The BM77 PICtail Board can be inserted into the PICtail Plus/PICtail interface header
on Microchip development tools as shown in Figure 1-5 and Figure 1-6.
Note:
DS50002409A-page 16
Ensure that the BM77 module on the board is facing the PIC PIM while
inserting the BM77 PICtail Board into either of the PICtail headers.
FIGURE 1-5:
BM77 PICtail™ BOARD INSERTED INTO PICtail PLUS
INTERFACE
FIGURE 1-6:
BM77 PICtail™ BOARD INSERTED INTO PICtail INTERFACE
 2015 Microchip Technology Inc.
BM77 PICtail™/PICtail PLUS BOARD
USER’S GUIDE
Chapter 2. Getting Started
2.1
INTRODUCTION
This chapter describes how to establish Bluetooth® serial data connections using the
BM77 PICtail™ Board over the USB-UART MCP2200 interface (P1). The purpose of
the exercise is to demonstrate the basic data capabilities of the BM77 module, and its
interoperability with other Bluetooth devices. Note that in all these demonstrations, the
BM77 is a Bluetooth slave device, waiting for a connection initiated by the Bluetooth
master device.
This chapter discussed the following topics:
•
•
•
•
2.2
Hardware Requirements
Software Requirements
Using BM77 PICtail Board in USB-UART Serial Interface Mode
Using BM77 PICtail Board in PICtail Interface Mode
HARDWARE REQUIREMENTS
The following hardware applications are required to demonstrate the BM77 PICtail:
• BM77 PICtail Board, (Part#BM77-PICtail) available for purchase on
www.microchipdirect.com
• Bluetooth-enabled Smartphone or Tablet
- Android™ device running Android 4.3 or later
- iOS: iPhone® 4S or later, iPad®3 or later, must support Bluetooth Low Energy
• Windows® Host PC with USB port
• Bluetooth adapter supporting 2.0+EDR or later
2.3
SOFTWARE REQUIREMENTS
The following software applications are required to demonstrate the BM77 PICtail:
• Bluetooth (BT) Chat Tool, BT Chat v004.exe file available for download from
www.microchip.com/bm-77-pictail under “PC ChatTool”
• Android BtChat APP, BtChat_V1.0.3.apk file available for download from
www.microchip.com/bm-77-pictail under “BM77 Android App Demo”
• iOS Terminal "BLETR", available on Apple® AppStore (iOS)
• MCP2200 driver for Windows, available from www.microchip.com/MCP2200
• PC terminal emulator such TeraTerm or CoolTerm
2.4
USING BM77 PICtail BOARD IN USB-UART SERIAL INTERFACE MODE
This section discusses the following topics:
• how to exercise the BM77 module using the USB-UART serial interface on the
BM77 PICtail Board,
• how to establish the Bluetooth Classic and Bluetooth Low Energy data
connections,
• how to transfer data on the BM77 module through the USB-UART serial interface
that is demonstrated via PC utility and Smartphone applications.
 2015 Microchip Technology Inc.
DS50002409A-page 17
BM77 PICtail™/PICtail Plus Board User’s Guide
2.4.1
Bluetooth® SPP Connection to Android Smartphone/Tablet
In this demonstration, a Bluetooth SPP data connection is established between the BT
Chat Tool and the Smartphone application via the BM77 PICtail Board. For the SPP
demonstration, an Android 4.3 or later Smartphone or tablet is required.
As illustrated in Figure 2-1, the host PC runs a BT Chat Tool application, transferring
serial data over a COM port (USB virtual COM port) to the BM77 PICtail Board. The
serial data is transmitted over a Bluetooth connection to the remote Bluetooth device,
which is the Android BT Chat APP.
FIGURE 2-1:
BLUETOOTH® SPP CONNECTION TO SMARTPHONE
To establish a connection, perform the following steps:
1. Ensure that the BM77 PICtail Board is unplugged from the PICtail interface of a
Microchip development board.
2. Verify that SW4 switches are set to application mode as specified in Table 1-2.
3. Ensure that SW1 button is in the ON position (pushed down).
4. Use a mini-B USB cable and connect the BM77 PICtail Board mini-B USB
receptacle (P1) to a host PC USB port to power up the BM77 PICtail Board. Refer
to Figure 2-2. The blue connection LED1 (D1) indicates the connection state as
follows:
• Stand-by State - The LED1 on BM77 PICtail Board blinks once at a time
• Pairing, Connected State - The LED1 blinks twice at a time.
FIGURE 2-2:
DS50002409A-page 18
CONNECT THE BM77 PICtail™ BOARD TO A HOST PC USB
PORT
 2015 Microchip Technology Inc.
5. Ensure that the Virtual COM port is created.
Note:
A virtual COM port must be created when the BM77 PICtail Board is connected to a PC. If a virtual COM port is not detected in the Device Manager
port list, download and install the Microchip MCP2200 driver from
www.microchip.com/MCP2200.
6. Run the BT Chat v004.exe file on the host PC and ensure that the COM Port
is connected. The steps to connect to the COM Port are represented in
Figure 2-3:
a. Select the COM Port assigned to the BM77 PICtail Board
b. Ensure that the default Baud Rate is 115200
c.
Click Connect button
FIGURE 2-3:
CONNECT TO COM PORT
7. The Connect button changes into a Disconnect button once Step 6 is completed. Use the “Input” field to enter the characters to transmit. Click Send to
transmit text to Smartphone over the BM77 PICtail Board Bluetooth connection.
The BT Chat tool settings are represented in Figure 2-4:
a. Select the “Burst send” check box to enable sending the text repeatedly from
this tool.
b. Input a value into the “Repeat” field to set the number of times allowed to
resend the text.
c.
Select the desired value from the “Interval” drop-down list to set the time
interval between two successive sent attempts.
d. Press the Clear button to delete the text on the screen, if required.
 2015 Microchip Technology Inc.
DS50002409A-page 19
BM77 PICtail™/PICtail Plus Board User’s Guide
FIGURE 2-4:
BT CHAT TOOL SETTING
b
c
a
d
Note:
Black texts are sent from PC tool (BM77 PICtail Board) to Smartphone.
Red texts are sent from Smartphone to the PC tool (BM77 PICtail Board).
8. Install the Android Bluetooth Chat application into the Android device by copying
or downloading the BTChat_V1.0.3.apk file. The .apk file can be copied into
the Android device by using an SD Card to transfer the file, or by plugging
Android device into the host PC where the Android device mounts as an external
USB drive. Note that Android Media Transfer Protocol (MTP) is required on host.
Once the .apk file is copied into the Android device, perform the following
instructions:
a. Select the downloaded file. Click to open file to install from Android File
Manager "My Files" App. If necessary, enable the "Unknown Sources" from
the Device Security settings of the phone to allow the installation. Refer to
Figure 2-5.
DS50002409A-page 20
 2015 Microchip Technology Inc.
FIGURE 2-5:
INSTALL THE ANDROID BLUETOOTH CHAT APPLICATION
b. The BtChat APP displays in Application view after successful installation.
Refer to Figure 2-6.
FIGURE 2-6:
BTCHAT APP ON ANDROID
BtChat Application
9. To pair the BM77 PICtail Board with the Android Device, open the Settings >
Bluetooth page on the Android device and then set to ON to turn ON Bluetooth
as shown in the left image of Figure 2-7. Press Scan to initiate the Bluetooth
Device scan, find the BM77 PICtail Board device named Dual-SPP and then
select to start the pairing process. Once paired, the Dual-SPP (BM77 PICtail
Board) device is listed in the paired device list as shown in the right image of
Figure 2-7.
 2015 Microchip Technology Inc.
DS50002409A-page 21
BM77 PICtail™/PICtail Plus Board User’s Guide
FIGURE 2-7:
PAIR BM77 PICtail™ BOARD WITH THE ANDROID DEVICE
Turn ON
Bluetooth
Dual-SPP
Start pairing
Press Scan
10. Launch the BtChat APP on the Android Device to display the BtChat APP main
window. To open BtChat menu options, use the menu button of the phone. Select
the Setting button to open the APP setting view. To show the received text in the
APP, select the “Show Rx Text” check box. Press the Back button of the phone
to return to the main window. Refer to Figure 2-8.
FIGURE 2-8:
SET BTCHAT APP
BTChat APP main window
DS50002409A-page 22
Select Setting
Enable “Show Rx Text”
 2015 Microchip Technology Inc.
11. To set up a Bluetooth SPP connection to the BM77 PICtail device, go to the
BtChat APP main window, press the menu button of the phone to open the
BtChat menu options and then select the Connect a device button to open the
paired device list. Select the Dual-SPP device to open the SPP connection to the
BM77 PICtail Board. A status message displays in the main window when a connection is established. Refer to Figure 2-9.
FIGURE 2-9:
SET UP THE BLUETOOTH SPP CONNECTION
Select Connect a device
Select Dual-SPP
Connection established
12. To transfer data from the BM77 to the Android Device via Bluetooth SPP connection, launch the BT Chat Tool on the host PC and set the correct COM port corresponding to the BM77 PICtail Board as described in Figure 2-3.
a.
Enter text into Android BtChat APP to send it to the BT Chat Tool on the PC.
Click Send to transmit the text entered to BM77 that is connected to the BT
Chat Tool. Text received on the BT Chat Tool window displays in red.
b.
Enter text into the BT Chat Tool to send it to the BM77 PICtail Board. Click
Send to transmit text to the Android BtChat APP. Text is received in Android
BtChat APP. Refer to Figure 2-10.
 2015 Microchip Technology Inc.
DS50002409A-page 23
BM77 PICtail™/PICtail Plus Board User’s Guide
FIGURE 2-10:
2.4.2
DATA TRANSFER FROM BM77 TO ANDROID DEVICE
Bluetooth Low Energy Data Connection to iOS Device
This demonstration shows how serial data is transmitted from the BM77 PICtail Board
(via PC Chat) to an iOS device using Bluetooth Low Energy (BLE) connection. This
demonstration uses ISSC BLETR APP to establish connection with the BM77 PICtail
Board. BLETR can be downloaded from APP Store and ensure to disable the “iPad
only” filter as this is an iPhone APP. A key feature of the BM77 module is the transparent serial data connection from BM77 UART to an iOS device over Bluetooth Low
Energy connection.
1. Download and install "ISSC BLETR" APP from Apple AppStore (iOS) using an
iPhone 4S or later, iPad3 or later devices. Refer to Figure 2-11.
FIGURE 2-11:
DS50002409A-page 24
ISSC BLETR APP
 2015 Microchip Technology Inc.
2. Go to Settings > General > Bluetooth Page. Turn ON the Bluetooth. Refer to
Figure 2-12.
FIGURE 2-12:
TURN ON BLUETOOTH
3. Launch the ISSC BLETR APP to scan for the Bluetooth Low Energy (BTLE)
peripheral devices. If the device is not displaying on the list, press the Refresh
or Scan button to restart the BTLE peripheral scan. Find the Dual-SPP device
and then select to start a connection to the BM77 PICtail Board. Refer to
Figure 2-13.
FIGURE 2-13:
SCAN FOR BTLE DEVICES
Select Dual-SPP
 2015 Microchip Technology Inc.
DS50002409A-page 25
BM77 PICtail™/PICtail Plus Board User’s Guide
4. BLETR displays the status of the Dual-SPP device as connected after a
successful connection. Refer to Figure 2-14.
FIGURE 2-14:
DUAL-SPP CONNECTED
5. Select the connected Dual-SPP device to display the top level view. Refer to
Figure 2-15.
The top level view displays the following three options when connected to a BM77
PICtail Board as shown in Figure 2-16:
• Transparent - This view enables to display the received data, send data, and activate features.
• Proprietary - This view sets the Bluetooth Low Energy connection parameters.
• Device Info - This view displays the settings for Bluetooth Low Energy Device
Information Service.
DS50002409A-page 26
 2015 Microchip Technology Inc.
FIGURE 2-15:
ISSC BLETR APP TOP LEVEL VIEW
FIGURE 2-16:
ISSC BLETR APP OPTIONS
 2015 Microchip Technology Inc.
DS50002409A-page 27
BM77 PICtail™/PICtail Plus Board User’s Guide
2.4.2.1
TRANSPARENT DATA VIEW
The Transparent data view enables to display received data, send data, and activate
features. Selecting Transparent button opens the transparent serial data view as
shown in Figure 2-17. The default mode is Raw mode (ASCII) where the received data
characters displays in red font in the large text box.
FIGURE 2-17:
DATA MODE TRANSFER
Select the input text box to send data from BLETR iOS device to the BM77. The soft
keyboard displays that enables the user to enter text in the input text box. Click Send
to transmit text to the BM77 over BLE connection. Refer to Figure 2-18.
FIGURE 2-18:
DS50002409A-page 28
SOFT KEYBOARD
 2015 Microchip Technology Inc.
The text is received via the BM77 UART after clicking Send and displays in the BT Chat
Tool window on the PC as shown in Figure 2-19.
FIGURE 2-19:
TEXT RECEIVED VIA THE BM77 UART
Timer Feature
In addition to the Raw mode (ASCII), the Transparent data view also includes the Timer
and Echo features, refer to Figure 2-17. The Timer feature enables the BLETR to send
a repeated test pattern to BT Chat Tool for throughput and data transfer test.
Figure 2-20 shows an example of the Timer test feature.
BLETR is configured to transmit a 100 test blocks of 20 characters in every 1000 ms.
BT Chat Tool on PC receives the test pattern data and displays it in red text. The line
break indicates a Bluetooth Low Energy packet break, which means that a transmitted
test block is fragmented into multiple BLE packets. Clicking the Start button initiates
the data transfer.
FIGURE 2-20:
 2015 Microchip Technology Inc.
TIMER TEST FEATURE
DS50002409A-page 29
BM77 PICtail™/PICtail Plus Board User’s Guide
Echo Feature
The Echo feature is an optional function for the Transparent data view. If Echo is
enabled, any data received by BLETR is echoed back to the sender. Figure 2-21 shows
text sent from BT Chat Tool (PC) being echoed to BLETR when the Echo mode is
enabled.
FIGURE 2-21:
ECHO FEATURE
TX File Feature
Another test feature similar to the Timer feature is the TX File transfer. The TX File function transfers files that is embedded in the BLETR APP to the BM77. The steps to use
this feature are represented in Figure 2-22:
a. Click the TX File button to open a dialog box with the list of file sizes to transmit.
b. Select the file size to send.
c.
Observe the file received on BT Chat Tool.
FIGURE 2-22:
TX FILE FEATURE
c
b
a
DS50002409A-page 30
 2015 Microchip Technology Inc.
2.4.2.2
PROPRIETARY DATA VIEW
The Proprietary data view demonstrates the capability to remotely change the Bluetooth Low Energy connection parameters via BLETR application. These parameters
only affect Bluetooth Low Energy connections.
• Max Interval - communication time interval (ms) between BM77 and BLE Central
device.
• Connection Timeout - determines the timeout (ms) between data exchanges
before a connection is considered lost without risking disconnection.
• Latency - number of peripheral (BM77) connection events allowed to be skipped.
• BLE name used to advertise Peripheral name to scan Central devices. To change
device name, type new name in the text box and click Change Name to apply the
change. Refer to Figure 2-23.
FIGURE 2-23:
 2015 Microchip Technology Inc.
CHANGE DEVICE NAME
DS50002409A-page 31
BM77 PICtail™/PICtail Plus Board User’s Guide
2.4.2.3
DEVICE INFORMATION VIEW
The Device Information view displays the characteristics associated with Device
Information service. The Device Information service is available to all Bluetooth 4.0
Low Energy hosts that access the BM77 PICtail Board. It provides the identification
information about the BM77 BLE peripheral device. Refer to Figure 2-24.
FIGURE 2-24:
DS50002409A-page 32
DEVICE INFORMATION
 2015 Microchip Technology Inc.
2.5
USING BM77 PICtail BOARD IN PICtail INTERFACE MODE
This section provides an overview of tools that are used to configure the BM77 module
on the BM77 PICtail/PICtail Plus Board using a PIC MCU through the PICtail interface.
The BM77 Configuration UI Tool or BM77 UI Tool is used to edit the Bluetooth parameters stored in the EEPROM configuration file.
The BM77 EEPROM Table Utility as described in Section 2.5.2 “BM77 EEPROM
Table Utility” is used to convert the EEPROM configuration file into an EEPROM structure file, which can be read by the PIC library running PIC MCU. The EEPROM structure file can be imported by the BM77 Configuration Library demo workspace to
program the Bluetooth parameters into the BM77 module through the PICtail interface
over UART.
2.5.1
BM77 Configuration User Interface (UI) Tool
BM77 module provides the ability to update and configure various Bluetooth configuration parameters. The BM77 UI Tool is an easy-to-use PC application enabling the user
to update the various Bluetooth parameters available that are saved into the EEPROM
configuration file. The Bluetooth parameters saved in the EEPROM configuration file
can be downloaded into the BM77 module using the BM77 Configuration Library as
described in Section 2.5.3 “BM77 Configuration Library”.
Note:
The tools and utilities can be downloaded from the BM77 PICtail web page
at www.microchip.com.
To configure the BM77 UI Tool, perform the following steps:
1. Download the BM77 UI Tool into a Windows PC and run the application.
2. Click Load button to import the default EEPROM configuration file
bm77_eeprom_configuration_dump_default.txt provided with the
application. Refer to Figure 2-25.
FIGURE 2-25:
 2015 Microchip Technology Inc.
BM77 UI TOOL
DS50002409A-page 33
BM77 PICtail™/PICtail Plus Board User’s Guide
3. Browse to import the default EEPROM configuration file and click Open button.
Refer to Figure 2-26.
FIGURE 2-26:
OPEN EEPROM CONFIGURATION FILE
4. Click Edit button after the default EEPROM configuration file is imported into the
BM77 UI Tool. Refer to Figure 2-27.
FIGURE 2-27:
EDIT BM77 UI TOOL
5. The BM77 UI Tool opens the Bluetooth configuration window with various tabs to
configure various available parameters as shown in Figure 2-28. To configure the
Bluetooth parameters desired for the specific application, click Help button for
each parameter. If the configuration is completed, click Finish button.
DS50002409A-page 34
 2015 Microchip Technology Inc.
FIGURE 2-28:
BLUETOOTH CONFIGURATION WINDOW
6. Click Save button to save the updated EEPROM configuration file. Refer to
Figure 2-29.
FIGURE 2-29:
 2015 Microchip Technology Inc.
SAVE EEPROM CONFIGURATION FILE
DS50002409A-page 35
BM77 PICtail™/PICtail Plus Board User’s Guide
The new EEPROM configuration file is different from the default EEPROM configuration file due to the updates on the Bluetooth parameters using the BM77 UI
Tool. Refer to Figure 2-30.
FIGURE 2-30:
2.5.2
UPDATED EEPROM CONFIGURATION FILE
BM77 EEPROM Table Utility
The BM77 EEPROM Table Utility is used to create a file with an EEPROM table structure from the EEPROM configuration file that is created by the BM77 Configuration
User Interface (UI) Tool. For more information on the BM77 tool, refer to
Section 2.5.1 “BM77 Configuration User Interface (UI) Tool”.
The EEPROM table structure file can be imported into BM77 Configuration Library
MPLAB workspace. Using this EEPROM table file, all EEPROM parameters on the
BM77 can be updated.
To install the BM77 EEPROM Table Utility, use the BM77 Configuration Library
Installer:
1. Execute the bm77_eeprom_table_utility.exe in the
bm77_eeprom_table_utility directory.
2. Browse and open the EEPROM configuration file created in
Section 2.5.1 “BM77 Configuration User Interface (UI) Tool”. Click OK button
on the message dialog box.The message displays on the command window as
shown in Figure 2-31.
DS50002409A-page 36
 2015 Microchip Technology Inc.
FIGURE 2-31:
OPEN THE EEPROM FILE
3. A File Browser dialog box opens for the user to browse. Click Open button to
open the EEPROM configuration file as shown in Figure 2-32.
FIGURE 2-32:
 2015 Microchip Technology Inc.
FILE BROWSER DIALOG BOX
DS50002409A-page 37
BM77 PICtail™/PICtail Plus Board User’s Guide
4. In Step 2, if the user clicks the Cancel button and does not browse and open the
EEPROM dump file, an error is displays on the command window. A message
dialog box opens to indicate the error. Click OK button on the message dialog
box to close the application and restart if desired. Refer to Figure 2-33.
FIGURE 2-33:
ERROR MESSAGE - OPENING THE EEPROM FILE
5. Browse, assign a name, and then save the EEPROM table file to be used by the
BM77 Configuration Library. Click OK button on the message dialog box. Refer
to Figure 2-34.
FIGURE 2-34:
DS50002409A-page 38
BROWSE, ASSIGN FILE NAME AND SAVE FILE
 2015 Microchip Technology Inc.
6. A File Browser dialog box opens for the user to browse, assign a name and save
the EEPROM table file to be used by the BM77 Configuration Library. Type in a
file name and click Save button to save the EEPROM table file. Refer to
Figure 2-35. The file path is indicated on the command window and the application proceeds to the next step.
FIGURE 2-35:
FILE BROWSER DIALOG BOX TO BROWSE AND SAVE THE
EEPROM TABLE FILE
If the user chooses to click Cancel button and not to browse and open the
EEPROM file, an error message displays on the command window. A message
dialog box opens to indicate the error. Refer to Figure 2-36. Click OK button on
the message dialog box to close the application and restart if desired.
FIGURE 2-36:
 2015 Microchip Technology Inc.
ERROR MESSAGE - SAVING THE EEPROM TABLE FILE
DS50002409A-page 39
BM77 PICtail™/PICtail Plus Board User’s Guide
7. The application creates the EEPROM table structure file. The progress is shown
on the command window. Refer to Figure 2-37. The EEPROM table is created in
the file that the user selects in Step 6. A message displays on the command window and a message dialog box opens after an EEPROM table file
bm77_eeprom_table.txt is successfully created. Click OK button on the
message dialog box to proceed to the next step.
FIGURE 2-37:
MESSAGE SHOWING THE PROGRESS AND COMPLETION
OF THE EEPROM TABLE CREATION
If the EEPROM configuration file that the user selects in Step 3 is corrupted, an
error displays in the command window followed by an error dialog box. Refer to
Figure 2-38. Click OK button on the error dialog box and restart the application
using a good EEPROM configuration file.
FIGURE 2-38:
DS50002409A-page 40
ERROR DUE TO CORRUPTED EEPROM FILE
 2015 Microchip Technology Inc.
8. Copy the EEPROM table file created by the utility into the BM77 Configuration
Library workspace folder. Import the EEPROM table file into the workspace to
configure BM77 with the EEPROM table. For an example on how to import and
use the EEPROM table, refer to the bm77_configure_demo.X workspace
installed as part of the PIC configuration library.
2.5.3
BM77 Configuration Library
The BM77 Configuration Library provides a set of functions to create command protocol packets to perform the following fiunctions:
• Update the System, the Bluetooth Classic and Low-Energy configuration parameters of BM77
• Set/get the EEPROM configuration parameters
• Bulk write of EEPROM configuration
• Perform pairing procedure with BM77
• Configure a subset of parameters in application mode on BM77
• Put the BM77 into different operating modes
The BM77 Configuration Library Installer is available on the BM77-PICtail webpage at
www.microchip.com/bm-77-pictail. To install the BM77 Configuration Library along with
BM77 Configure Demo MPLAB workspace and BM77 EEPROM Table Utility, download
the BM77 Configuration Library Installer into a Windows PC, open the installer application and then follow the installer instructions. The readme.txt provides an overview
of the components installed and available documentation.
The BM77 uses the UART interface for configuration and data transfer. If the BM77 is
paired and connected, and the SPP profile is active, the data transferred is raw by
nature. The BM77 Configuration and Events are defined as Command and Response
protocol packets. Command packet is sent to BM77 over UART to update a parameter.
Response packet is received from BM77 over UART for the command issued. The
BM77 also sends Event packets over UART when a defined event occurs. For more
information on the available functions in the BM77 configuration library, refer to the
BM77ConfigLibraryHelp.chm file.
The BM77 configures a demo that showcases a proof-of-concept example on how to
interface with the BM77 PICtail/PICtail Plus Board with a PIC microcontroller (MCU). In
this demonstration, the BM77 module on the BM77 PICtail is configured through the
PIC MCU. A Bluetooth device can be paired and connected to the BM77 module after
configuring the BM77. Data can be transferred to and from the BM77 module once connected.
To start the demo, perform the following steps:
1. Set a few Bluetooth parameters using the EEPROM mode to access and update
the parameters on the EEPROM.
2. The demo initiates the application mode and the BM77 module enters the Configure mode. In Configure mode, the demo gains access and reupdates some of
the Bluetooth parameters to show an example of the application mode functions
usage.
3. The BM77 waits for the Pairing procedure after exiting the Configure mode. If the
connecting Bluetooth device initiates the Pairing procedure, the BM77 performs
pairing by prompting the user for a passkey or confirmation as required. Once the
pairing is complete where the Bluetooth device is connected to the BM77 and the
SPP is active with an emulated serial cable, the connection is enabled. The demo
enables the data transfer over UART between the BM77 and the connected
Bluetooth device.
4. The debug UART is used to perform the pairing procedure and for data transfer
to and from the BM77 when connected.
 2015 Microchip Technology Inc.
DS50002409A-page 41
BM77 PICtail™/PICtail Plus Board User’s Guide
The EEPROM_BULK_WRITE preprocessor directive enables bulk write of the EEPROM
instead of the default function that configures each EEPROM parameter. Using
EEPROM_BULK_WRITE, the EEPROM table file included in BM77_EEPROM_TABLE is
created using the BM77 EEPROM Table Utility through
bm77_eeprom_table_utility.exe found in bm77_eeprom_table_utility
folder. Refer to Section 2.5.2 “BM77 EEPROM Table Utility”.
The BM77 configure demo performs the following functions:
• Configuration - Sets and gets a few BM77 EEPROM configuration parameters or
performs bulk write of EEPROM based on selected option and invokes functions
in the Configure mode.
• Pairing procedure - Performs pairing based on the Pairing mode selected. If Just
Works mode is selected, the pairing requires no user intervention. If Passkey
Entry mode or Passkey Yes/No Confirm mode is selected, user intervention is
required. In this demo, the debug UART port is used to enter passkey or yes/no
confirmation. If Passkey Entry mode is selected, the program prompts the user to
enter the entry key on the debug UART port. In this case, enter the 6-digit passkey
and press <Enter>. If Passkey Yes/No Confirm mode is selected, the program
prompts the user to enter the yes/no confirmation on the debug UART port by
entering a <y> or <n> response, and then press <Enter>.
• Data Connection - Once the pairing procedure completes successfully and the
Bluetooth device connects to BM77, the debug UART is used to transfer data to
and from the BM77.
The BM77 PICtail uses the UART interface and GPIO ports to configure, control and
transfer data to the PIC MCU. For more information on the UART configuration, refer
to the BM77SPPx3MC2 Bluetooth® 4.0 Dual Mode Module Data Sheet available for
download from http://www.microchip.com/products/BM77.
The following are examples of supported hardware combinations in the BM77
Configure Demo MPLAB workspace:
• MPLAB PIC32 Configuration
- Explorer 16 Development Board (DM240001)
- PIC32MX795F512L Plug-In Module (MA320003)
- BM77 PICtail/PICtail Plus Board (BM-77-PICTAIL)
• MPLAB PIC24 Configuration
- Explorer 16 Development Board (DM240001)
- PIC24FJ128GA010 Plug-In Module (MA240011)
- BM77 PICtail/PICtail Plus Board (BM-77-PICTAIL)
• MPLAB PIC18 Configuration
- PIC18 Explorer Board (DM183032)
- PIC18F87J11 Plug-In Module (MA180020)
- BM77 PICtail/PICtail Plus Board (BM-77-PICTAIL)
DS50002409A-page 42
 2015 Microchip Technology Inc.
The steps described in Section 2.4.1 “Bluetooth® SPP Connection to Android
Smartphone/Tablet” and Section 2.4.2 “Bluetooth Low Energy Data Connection
to iOS Device” in using the BTChat APP on Android device and the ISSC BLETR APP,
can be used to pair, connect, and transfer data to the BM77 PICtail Board, with the
exception that the BM77 PICtail Board is interfaced to a PIC MCU over the PICtail interface and then transfer data through the PICtail interface and not the USB-UART
MCP2200 interface.
To program/debug the BM77 Configure Demo MPLAB workspace, perform the
following steps:
1. Plug the PIC Plug-In-Module (PIM) into the relevant Explorer Development
Board based on the hardware combination selected for evaluation.
Note:
If using PIC32MX795F512L PIM, ensure that on jumpers J1 and J2 on the
PIM, pins 2 and 3 are connected using a jumper to select the CAN configuration and all jumpers on J9 and J10 on the PIM are not connected.
2. Plug the BM77 PICtail/PICtail Plus Board into the Explorer Development Board
with the BM77 module facing towards the PIC PIM as shown in Figure 1-5 or
Figure 1-6 based on the hardware combination used.
3. [Optional] A debug UART port can be connected to a PC terminal emulator
program.
Note:
Using the Explorer 16 Development Board, a debug UART is available on
the DB9 UART serial connector P1. If using the PIC18 Explorer Board, the
debug UART must be manually tapped from pins RG1/TX2 and RG2/RX2
on J5 header using an external wiring.
4. Provide power through the 9V power input port available on the Explorer
Development Board.
5. Program the PIC32 with the bm77_configure_demo_xc32.hex or the PIC24
with the bm77_configure_demo_xc16.hex or the PIC18 with the
bm77_configure_demo_xc8.hex in the “precompiled_hex” sub-directory.
6. Alternately, open the bm77_configure_demo.X MPLABX workspace using
the MPLABX IDE to compile and program or enter Debug mode and then select
any of the following workspace configurations (PIC32, PIC24, or PIC18) based
on the specified hardware combination as shown in Figure 2-39.
FIGURE 2-39:
 2015 Microchip Technology Inc.
SELECTED WORKSPACE CONFIGURATION
DS50002409A-page 43
BM77 PICtail™/PICtail Plus Board User’s Guide
To run the BM77 Configure Demo MPLAB workspace after setting up the hardware
combination and programming the PIC, perform the following the steps:
1. Observe the BM77 configuration by inserting break points in the workspace or
optionally use the debug UART.
2. On BM77 web page, click on the BM77 Android App Demo to download the
Android APK file (BtChat_V1.0.3.apk).
3. Open the BtChat APP installed by the BtChat_V1.0.3 and scan for the
Bluetooth devices on the Android device.
4. Select the BM77 device in the scan list and click to pair and connect.
5. The application uses Just Works pairing by default. If using the Passkey Entry or
Passkey Yes/No Confirm mode, provide the passkey or confirmation using the
debug UART port.
6. Once connected, the data can be transmitted from BM77 through the debug
UART port to the BtChat APP over the Bluetooth link. Enable “Show Rx Text”
option in the BtChat APP settings. The BtChat APP sends data back to the BM77
that is later received through the debug UART.
Alternately, any suitable Bluetooth SPP Data Terminal application can be used to transfer data back and forth by following the steps described in this demonstration.
DS50002409A-page 44
 2015 Microchip Technology Inc.
BM77 PICtail™/PICtail PLUS BOARD
USER’S GUIDE
Appendix A. BM77 Module PIN Assignment
A.1
BM77 MODULE PIN ASSIGNMENT
Figure A-1 shows the pinout for BM77 module.
FIGURE A-1:
BM77SPP03 MODULE PIN ASSIGNMENT
U4
BAT_IN
SW_BTN
BAT_IN
SW_BTN
LDO33_O
VDD_IO
LDO18_O
WAKEUP_SI1
PMULDO_O
P04
P15
P12/SCL
P13/SDA
GND
LED1
P37
P36
P34/SCLK
P33/MOSI
P32/MISO
P31/NCS
HCI_TXD
HCI_RXD
RST_N
30
BT_RF1
29
28
27
26
25
24
23
22
21
20
19
LED
P37
P36
P34
P33
P32
P31
UART_TXD
UART_RXD
RST_N
UART_CTS/P17
P05
UART_RTS/P00
P20
P24
EAN
13
14
15
16
17
18
2
3
4
5
6
WAKEUP
7
PMULDO_O 8
P04
9
P15
10
P12/SCL
11
P13/SDA
12
BT_RF
GND
P17
P0_5/TX_CLS1
P00
P20
P2_4/RX_CLS1
EAN
1
Table A-1 describes the pins for BM77 module.
TABLE A-1:
BM77 MODULE PIN DESCRIPTION
PIN
Type
1
P
GND
Name
Ground
2
P
BAT_IN
4.2~3.3V Power input
3
I
SW_BTN
Input for software button
H: Power On
L: Power Off
4
P
LDO33_O
3V3 LDO output
5
P
VDD_IO
Main power supply
 2015 Microchip Technology Inc.
Description
DS50002409A-page 45
BM77 PICtail™/PICtail Plus Board User’s Guide
TABLE A-1:
BM77 MODULE PIN DESCRIPTION (CONTINUED)
PIN
Type
Name
Description
6
P
LDO18_O
LDO18 output
7
I
WAKEUP
Wakes BM77 from Shutdown state (Active-Low)
Valid only while BM77 is in Shutdown state
8
P
PMULDO_O
Power management unit output
9
O
P04
UART_TX_IND:
H: BM77 indicates that UART data is transmitted out after a certain
timing. (Setting by EEPROM, default 5 ms)
L: Otherwise.
STATUS_IND_2:
BM77 State indication, refer to P15
10
O
P15
STATUS_IND:
Bluetooth link status indication
P15/P04: HH - Power default value and Shutdown state
P15/P04: HL - Access state
P15/P04: LL - Link state without UART_TXD
P15/P04: LH - Link state with UART_TXD
11
N/A
P12/SCL
I2C_SCL, Reserved
12
N/A
P13/SDA
I2C_SDA, Reserved
13
I
P17
- UART_CTS:
- Configurable Functional GPIO
14
I/O
P05
Configurable Functional GPIO
15
O
P00
- UART_RTS
- Configurable Functional GPIO
16
I
P20
System configuration, refer to P2_4. (No drive under APP mode)
17
I
P24
Boot mode selection. (No drive under APP Mode)
P2_0/P2_4:
HH - Application
LL - Boot mode
LH - HCI UART mode for testing and system configuration
18
I
EAN
ROM/Flash selection. (No drive under APP Mode)
H: ROM code
L: Flash code
19
I
RST_N
External reset input (Active-Low), Clock period 62.5n at least
20
I
HCI_RXD
UART_RXD
21
O
HCI_TXD
UART_TXD
22
I/O
P31
Configurable Functional GPIO
23
I
P32
Configurable Functional GPIO
24
I
P33
Configurable Functional GPIO
25
I
P34
Configurable Functional GPIO
26
O
P36
Reserved
27
I/O
P37
Configurable Functional GPIO
28
O
LED1
LED1 driver
29
P
GND
Ground
30
RI/O
BT_RF
RF Port
DS50002409A-page 46
 2015 Microchip Technology Inc.
BM77 PICtail™/PICtail PLUS BOARD
USER’S GUIDE
Appendix B. Schematics
B.1
BM77 PICtail™/PICtail Plus BOARD SCHEMATICS
Figure B-1 shows the BM77 PICtail/PICtail Plus Board schematics.
 2015 Microchip Technology Inc.
DS50002409A-page 47
BM77 PICTAIL™/PICTAIL PLUS BOARD SCHEMATICS
FP1
P0_5
BT_WAKE_UP
P0_4
P1_5
BT_UART_CTS
J1
P2_0
EAN
BT_UART_RTS
P3_2
P3_3
P3_4
2
4
6
8
10
12
14
16
18
20
22
24
26
28
RA5
RA4
RA3
RC5
RC4
RC3
RA0
RA1
RA2
RC0
RC1
RC2
V_VAR
GND
P3_1
P3_4
P3_3
P3_2
1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
SW_BTN
P2_4
P3_7
BT_RST_N
P0_4
BT_UART_RTS
EXT_3V3
P3_1
EXT_3V3
PICTAIL 28 Pin
P0_5
BT_RST_N
C3
1u/16V
C2
1u/16V
RB2/SS1/AN2
RF2/U1RX_E
RF6/SCK1
RF3/U1TX_E
RF7/SDI1_E
RG2/SCL1
RF8/SDO1_E
RG3/SDA1
GND
GND
RB0/AN0
RB1/AN1
RB3/AN3
RB4/AN4
GND
GND
RE9/INT2
RE8/INT1
RD14/U1CTS_E RD15/U1RTS_E
3.3V
3.3V
5V
5V
9V
9V
RG0
RF0
RG1
RF1
J2
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
BT_UART_TXD
BT_UART_RXD
P3_6
LED
1
2
P2_0
EAN
3
G
G
G
C1
10u/16V
P3_7
BT_WAKE_UP
4
5
6
7
8
9
10
11
12
13
14
SW_BTN
LDO33_O
VDDIO
LDO18_O
BT_WAKE_UP
PMULDO_O
P0_4
P1_5
P1_2/SCL
P1_3/SDA
INT_3V3
PICTAIL PLUS 30 Pin
C4
1u/16V
1
MCP1700T-33
C5
1u/16V
SW_BTN
2
VOUT
VIN
GND
SW1
C6
1u/16V
4
5
9
8
3
5V
DD+
6
max-current:250 mA
1
C9
12p/50V
2
2
2
R3
470
2
R14
1K
1
1
2
D
2
6
3
3
CN1
CONN 1x9
EXT_3V3
BAT_IN
SW_BTN
LDO33_O
VDDIO
LDO18_O
BT_WAKE_UP
PMULDO_O
P0_4
Push-on : pin 2-3
Push-off : pin 1-2
CN2
CONN 1x9
1
2
3
4
5
6
7
8
9
9
8
7
6
5
4
3
2
1
1
2
3
4
5
6
7
8
9
10
VDD
OSC1
OSC2
RST
GP7/TxLED
GP6/RxLED
GP5
GP4
GP3
TX
MCP2200
VSS
D+
DVUSB
GP0/SSPND
GP1/USBCFG
GP2
CTS
RX
RTS
20
19
18
17
16
15
14
13
12
11
CN3
CONN 1x9
D+
D-
C10
0.1u/16V
WAKE-UP
R10 3K
MCP22_CTS 1
2
BT_UART_RTS
2
BT_UART_TXD
BT_WAKE_UP
U3
RESET
SW2
R11 3K
MCP22_RXD 1
SW3
1
BT_RST_N
2
1
2
R13 3K
MCP22_RTS 1
2
BT_UART_CTS
TVBM17
TVBM17
BT_UART_RXD
1
S
STS2306
1
2
1
2
INT_3V3
2
1
R6 4K7
2
1
SW4
OFF
ON
6
5
4
3
2
1
ON
 2015 Microchip Technology Inc.
S
5V
R5 10
SW4
SW-3BIT
R7 4K7
2
1
EAN
P2_4
P2_0
INT_3V3
2
Q2 D
G
1
SW_BTN
2
31
2
5
1
1
Q3
STS2306
G
R15
10K
MCP22_TXD
R12
3K
3
EXT_3V3
1
EXT_3V3
X1
X4P-12MHZ
C11
0.1u/16V
2
LED
P3_7
P3_6
P3_4
P3_3
P3_2
P3_1
BT_UART_TXD
BT_UART_RXD
C8
0.1u/16V
3
2
1
31
30
29
28
27
26
25
24
23
22
1
2
3
4
5
6
7
8
9
4
1
R1
20K
4
PS-5177
EXT_3V3
C7
12p/50V
R2
10K
GND
LED1
P37
P36
P34/SCLK
P33/MOSI
P32/MISO
P31/NCS
HCI_TXD
HCI_RXD
EXT_3V3
U2
EXT_3V3
D1
LED-B
BAT_IN
SW_BTN
LDO33_O
VDD_IO
LDO18_O
WAKEUP_SI1
PMULDO_O
P04
P15
P12 / SCL
P13 / SDA
BT_UART_CTS
P0_5
BT_UART_RTS
P2_0
P2_4
EAN
BT_RST_N
7
6
1
2
3
4
5
VBUS
DD+
ID
GND
32
GND
FP-BM77SPPA
5V
P1
MU-05F4-48
33
BAT_IN
EXT_3V3
P1_5
BT_UART_CTS
G
P1_5
P1_2/SCL
P1_3/SDA
BT_UART_CTS
P0_5
BT_UART_RTS
P2_0
P2_4
EAN
BT_UART_TXD
BT_UART_RXD
RE2
RE3
RA7/OSC1
RA6/OSC2
RC7
RC6
RB7
RB6
RB5
RB4
RB3
RB2
RB1
RB0
P17
P0_5/TX_CLS1
P00
P20
P2_4/RX_CLS1
EAN
RST_N
1
3
5
7
9
11
13
15
17
19
21
23
25
27
15
16
17
18
19
20
21
SW_BTN
P2_4
JP1
JP 1x2
SW4
APP
MODE
TEST
MODE
WRITE
FLASH
EAN
OFF
OFF
ON
P24
OFF
OFF
ON
P20
OFF
ON
ON
External I2C
R8
10K
INT_3V3
2
1
R9
10K
1
P1_3/SDA
2
P1_2/SCL
C12
1u/16V
9
7
5
3
1
GND
CN4
10
8
6
4
2
SSQ-F-2x5-R
P3_6
P3_7
P3_6
P3_4
P3_3
P3_2
P3_1
BT_UART_TXD
BT_UART_RXD
BT_RST_N
BM77 PICtail™/PICtail Plus Board User’s Guide
DS50002409A-page 48
FIGURE B-1:
BM77 PICtail™/PICtail PLUS BOARD
USER’S GUIDE
Appendix C. Questions and Answers
C.1
QUESTIONS AND ANSWERS
1. Is the BM77 Module Data Sheet available?
Yes. The BM77 data sheet is available for download from the Microchip web site
at www.microchip.com/BM77.
2. When I connect the BM77 PICtail board to the host PC, the COM port does
not appear.
Try to unplug the USB cable and plug it back to the PC. Check if the MCP2200
drivers are installed. Otherwise, download and install the MCP2200 drivers.
3. What is the maximum supported Baud Rate of BM77 UART?
The maximum baud rate is 921600 used with 16 MHz crystal.
4. How do you change Bluetooth parameters such as name, Device Info, COD,
rate, inquiry and page scan windows?
The configuration settings are accessed using the UI Tool software utility. The
configuration settings can be updated on the BM77 using the BM77 Configuration Library. Contact your Microchip representative to request additional configuration tools including BM77 UI tool and other documentation for BM77.
5. What is default security mode for SPP?
Simple Secure Pairing (SSP)/Just Works mode.
6. Is there an Android™ BTLE demonstration application?
At this time, Android support for dual mode Bluetooth devices, such as the BM77,
is limited to Bluetooth Classic SPP data service.
7. Is the source code for iOS and Android APP available?
Contact your Microchip representative to request the source code packages for
the Smartphone Apps.
 2015 Microchip Technology Inc.
DS50002409A-page 49
Worldwide Sales and Service
AMERICAS
ASIA/PACIFIC
ASIA/PACIFIC
EUROPE
Corporate Office
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support:
http://www.microchip.com/
support
Web Address:
www.microchip.com
Asia Pacific Office
Suites 3707-14, 37th Floor
Tower 6, The Gateway
Harbour City, Kowloon
China - Xiamen
Tel: 86-592-2388138
Fax: 86-592-2388130
Austria - Wels
Tel: 43-7242-2244-39
Fax: 43-7242-2244-393
China - Zhuhai
Tel: 86-756-3210040
Fax: 86-756-3210049
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
India - Bangalore
Tel: 91-80-3090-4444
Fax: 91-80-3090-4123
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
India - New Delhi
Tel: 91-11-4160-8631
Fax: 91-11-4160-8632
Germany - Dusseldorf
Tel: 49-2129-3766400
Atlanta
Duluth, GA
Tel: 678-957-9614
Fax: 678-957-1455
Hong Kong
Tel: 852-2943-5100
Fax: 852-2401-3431
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
China - Beijing
Tel: 86-10-8569-7000
Fax: 86-10-8528-2104
Austin, TX
Tel: 512-257-3370
China - Chengdu
Tel: 86-28-8665-5511
Fax: 86-28-8665-7889
Boston
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
China - Chongqing
Tel: 86-23-8980-9588
Fax: 86-23-8980-9500
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Cleveland
Independence, OH
Tel: 216-447-0464
Fax: 216-447-0643
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
Novi, MI
Tel: 248-848-4000
Houston, TX
Tel: 281-894-5983
Indianapolis
Noblesville, IN
Tel: 317-773-8323
Fax: 317-773-5453
Los Angeles
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
New York, NY
Tel: 631-435-6000
San Jose, CA
Tel: 408-735-9110
Canada - Toronto
Tel: 905-673-0699
Fax: 905-673-6509
China - Dongguan
Tel: 86-769-8702-9880
China - Hangzhou
Tel: 86-571-8792-8115
Fax: 86-571-8792-8116
India - Pune
Tel: 91-20-3019-1500
Japan - Osaka
Tel: 81-6-6152-7160
Fax: 81-6-6152-9310
Japan - Tokyo
Tel: 81-3-6880- 3770
Fax: 81-3-6880-3771
Korea - Daegu
Tel: 82-53-744-4301
Fax: 82-53-744-4302
China - Hong Kong SAR
Tel: 852-2943-5100
Fax: 852-2401-3431
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
China - Nanjing
Tel: 86-25-8473-2460
Fax: 86-25-8473-2470
Malaysia - Kuala Lumpur
Tel: 60-3-6201-9857
Fax: 60-3-6201-9859
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
Malaysia - Penang
Tel: 60-4-227-8870
Fax: 60-4-227-4068
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
China - Shenzhen
Tel: 86-755-8864-2200
Fax: 86-755-8203-1760
Taiwan - Hsin Chu
Tel: 886-3-5778-366
Fax: 886-3-5770-955
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
Taiwan - Kaohsiung
Tel: 886-7-213-7828
China - Xian
Tel: 86-29-8833-7252
Fax: 86-29-8833-7256
Germany - Karlsruhe
Tel: 49-721-625370
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
Italy - Venice
Tel: 39-049-7625286
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
Poland - Warsaw
Tel: 48-22-3325737
Spain - Madrid
Tel: 34-91-708-08-90
Fax: 34-91-708-08-91
Sweden - Stockholm
Tel: 46-8-5090-4654
UK - Wokingham
Tel: 44-118-921-5800
Fax: 44-118-921-5820
Taiwan - Taipei
Tel: 886-2-2508-8600
Fax: 886-2-2508-0102
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
07/14/15
DS50002409A-page 50
 2015 Microchip Technology Inc.