Connecting to a Peer BM70

 Objective

Using two BM-70-PICtail boards, this lab will have you explore Generic Access Profile (GAP) discovery and connection procedures on the BM70 module. Module 1 will act as the Advertiser while Module 2 will be the Scanner. In Advertising mode, Module 1 will periodically transmit advertising information while Module 2 (the scanner device), will listen for advertising information transmitted by other devices.

Module 2 will also be the Initiator, which means it will be the module that initiates the connection by sending a connection request packet to Module 1. After the connection between both BM70 modules has been established, Module 1 becomes the Slave and Module 2 is, therefore, the Master.

You will:

  • Use the User Interface (UI) Configuration Tool to set up both modules to be used in Manual Pattern mode
  • Dynamically trigger GAP Discovery and Connection modes/procedures via BM70 OP codes using the Manual Pattern Test Tool
    • Place Module 1 in Standby mode (Advertising)
    • Perform a scan from Module 2 (Scanning)
    • Connect from Module 2 to Module 1 (Connecting)

 Materials

Hardware Tools

Tool About Purchase
BM70-pictail-50px.png
BM-70-PICTAIL
BM70 Bluetooth Low Energy PICtail™ Plus

This lab uses a BM70 PICtail™ board with version 1.06 of the firmware. If you don't have v1.06, go to the "BM70 Firmware Update" page to update your BM70 module.

Software Tools

Be sure to install the MCP2200 USB drivers before starting. Also, download/extract the UI Configuration Tool and the Manual Pattern Test Tool to your PC using the links above.

Peer-to-Peer Connection Roles

The link layer roles defined for unicast (peer-peer) connections evolve as a function of the state of the connection, as we see in the diagram below.

Roles.png

 Procedure

1

Connect Both PICtail Boards to Your PC

Connect both PICtail boards to your PC and keep track of which Port Number was assigned to each.

COMPorts.png

After connecting the PICtail boards to your PC, place the modules in Test mode by setting SW7 in the ON position, then press SW5 (Reset) to reset the modules. Also, ensure the jumpers are all set as shown:

BM70Update.png

With Jumper JP8 shorted, LED1 will be lit (BLUE) indicating the module is in Test mode, as shown above.

2

Launch the UI Configuration Tool

After extracting files from the v100.132.zip UI Configuration Tool ZIP file, double click on the IS187x_102_BLEDK3_UI v100.132.exe application file to launch the utility.

NewUILoad.png

Load the IS1870SF_102_BLEDK3_UI v100.132(BM70) default.txt default BM70 configuration file.

Select Edit. Ensure that the BLEDK3 radio button is checked and that BM70 is the device selected under the Main Feature window. Then press OK.

BLEDK3withBM70.png

3

UI Configuration

We will start with Module 1 and after writing those settings to the module, we will launch the UI Configuration Tool again to configure Module 2.

a

Module 1 Settings

Below you will find the settings for the System Setup tab on the first module.

SettingsModule1.png

The settings above are the minimum settings we need to change in order to be able to complete this lab. If you would like to know why we disabled UART RX_IND, or if you want to know more about other settings in the Manual Pattern Tool, you can refer to the "GAP Peripheral Demo (Making Connections)" page. That page goes into more detail about the different configuration settings that change the behavior of a Bluetooth® Low Energy (BLE) Peripheral (e.g., Advertising Packets, Advertising Intervals, Scan Response, etc.). However, for the purposes of this lab, we will use their default values.

To be able to identify the module's state at any given time, we decided to also update the LED settings in the LED Setup tab.

Module1LEDSettings.png

As we can see under the Standby LED Flash Setting, LED1 on the BM70 PICtail will blink quickly three times every two seconds while the module is on Standby mode (Advertising). Once a connection has been established, the LED will remain turned on per the Link LED Flash Setting. Press Finish to enter the EEPROM parameters into the module.

Module1Write.png

To program these settings into the BM70 module, click on Write. Then, choose the correct COM port for Module 1 and press Write again. You will see a window asking if you are sure you want to write those settings to the EFLASH, click Yes. Lastly, click OK on the last pop-up window confirming the write has been successful.

b

Module 2 Settings

Open the UI Configuration Tool (if you closed it after configuring Module 1). Load and Edit the BM70 default configuration file as you did in Step 2. Below are the minimum settings required for Module 2.

Module2Settings.png

After you've made those changes, you are ready to program them into the BM70 module; click on Finish as shown above.

Module2Write.png

Click on Write, then choose the correct COM port for Module 2 and press Write again. You will see a window asking if you are sure you want to write those settings to the EFLASH, click Yes. Lastly, click OK on the last pop-up window confirming the write has been successful.

4

APP Mode

Move dip-switch SW7 to the OFF position (1) on both modules and reset them by pressing SW5 (button immediately above dip-switch).

Switch.png

5

Manual Pattern Tool

Open two different instances of the Manual Pattern Tool and connect to each one of your modules.

ConnectedModules.png

6

Module 1 Standby

On the Manual Pattern Tool connected to Module1, click on the GAP tab. Select 0x1C: Set Adv Enable for Opcode and 0x01: Enter Standby Mode for Standby Mode. Click on Send and Module 1 will start Advertising.

To gain a better understanding of the different link layer states on the BM70, we recommend you visit the "BM70 BLE Connection States" page.

Module1Standby.png

If you changed the LED Setup settings in the UI Configuration Tool, you can take a look at your PICtail and you will see that the blue LED (P2_0/LED) will blink accordingly. In this case, it will blink three times every two seconds. Otherwise, it will blink once every three seconds (default setting).

LEDFlash.png

7

Module 2 Scan

On the Manual Pattern Tool for Module 2, click on the GAP tab. Select 0x16: Set Scan Enable for Opcode. Then, select the command to start scanning, which is 0x01: Scanning Enabled. Select 0x01: Duplicate Filtering Enabled for Filter Duplicate; this will ensure that we only see one instance of Module 1 on our Advertising List. Press Send.

Module2Scan.png

After a few seconds, you will see a list of various devices found nearby like the one below.

ScanResults.png

You will have to look through this list to find the name you gave your module. Module1 is circled in red above.

8

Module 2 Connect

On the Manual Pattern Tool for Module 2, go to the GAP tab. Select 0x17: LE Create Connection for Opcode. Go down to the list of devices that were found during the scan and select Module1. Doing this will automatically fill in the Peer Address field with the MAC address of the module we are trying to connect to. Lastly, issue the command by pressing Send.

Module2Connect.png

The Device Address we see above is a fundamental identifier, similar to an Ethernet MAC address. There are two types available:

  • Public device address
    • Equivalent to the IEEE-assigned MAC address that never changes.
  • Random device address
    • Dynamically generated at run time.

You can look at the BM70 PICtail and LED1 should be lit up indicating a Connected status. If you did not change the LED Setup settings on the UI Configuration Tool, blue LED (P2_0/LED) will blink twice every 1.5 seconds (default setting)

LinkLED.png

 Conclusions

In this lab, you were able to explore the different Opcodes needed to advertise, scan, and connect with a BM70 module.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site 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.