Objective

Using two BM-70-PICtail boards, this lab will have you explore 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 UI Configuration Tool to set up both modules to be used in Manual Pattern Mode

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

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.

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 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, I decided to also update the LED settings in the LED Setup tab.

As we can see under the Standby LED Flash Setting, LED1 on the BM70 PICtail will blink quickly 3 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.

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.

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

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).

5

Manual Pattern Tool

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

6

Module 1 Standby

On the Manual Pattern Tool connected to Module1, click on the GAP tab. Select Opcode0x1C: Set Adv Enable and on the Standby Mode setting, select 0x01: Enter 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, it is recommended you visit the BM70 BLE Connection States page.

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 my case, it will blink three times every two seconds. Otherwise, it will blink once every 3 seconds (default setting).

7

Module 2 Scan

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

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

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

8

Module 2 Connect

On the Manual Pattern Tool for Module 2, go to the GAP tab. Select Opcode0x17: LE Create Connection, 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.

​

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)

Conclusions

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

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.

Click here to edit contents of this page.

Click here to toggle editing of individual sections of the page (if possible). Watch headings for an "edit" link when available.

Append content without editing the whole page source.

Check out how this page has evolved in the past.

If you want to discuss contents of this page - this is the easiest way to do it.

View and manage file attachments for this page.

A few useful tools to manage this Site.

See pages that link to and include this page.

Change the name (also URL address, possibly the category) of the page.