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)
Reference Materials
- BM-70-PICTAIL
- BM70 Bluetooth Low Energy PICtail™ Plus
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.
Procedure
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.
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:
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.
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.
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.
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 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 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.
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 in 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.
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.
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).
Manual Pattern Tool
Open two different instances of the Manual Pattern Tool and connect to each one of your modules.
Module 1 Standby
On the Manual Pattern Tool connected to Module 1, 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.
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).
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.
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. Module1 is circled in red above.
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.
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.