Transparent UART DEMO (CoolTerm)

Last modified by Microchip on 2023/11/09 09:04

Objective

The first part of this lab exercise shows how to transfer data via the Transparent Universal Asynchronous Receiver Transmitter (UART) service using an iOS smartphone. The second part of the lab uses Microchip's Smart Discover app to connect to the BM71 module, and briefly discusses how you can configure LED1 on the PICtail™ to indicate different module statuses (Standby, Connected, etc.).

You will:

  • Configure the BM71 module to be used in Auto Pattern mode.
  • Use the Bluetooth® Smart Data app to communicate with the module via the Transparent UART service
  • Learn how to configure the blink rate of LED1 on the BM71 PICtail to indicate different BLEDK3 statuses.

Back to Top

Reference Materials


This lab uses a BM71 PICtail with version 1.06 of the firmware. If you don't have at least v1.06, go to the Firmware Upgrade page to update your BM71 module.

  • Apple® Smartphone
    • iOS version 5 or later
    • BT 4.0 or higher hardware

MCP2200 Windows® Drivers & Installer
User Interface (UI) Configuration Tool
Bluetooth Smart Data (iOS)
Smart Discover app (iOS)
Smart Discover app (Android™)

Terminal Emulator

Be sure to install the MCP2200 USB drivers before starting. Also, download and extract the UI Configuration Tool to your PC using the link above. Lastly, make sure you have installed the Bluetooth Smart Data (iOS) and the Smart Discover app on your smartphone.

Back to Top


Auto Pattern Mode State Machine

Auto Pattern Mode State Machine

The picture above represents the basic flow chart for the Auto Pattern mode state machine. After the device is powered on, it will enter the Standby State which means that the BM71 module is discoverable and connectable to a peer device. Then, it can enter the Link State which means that the BM71 module is connected to a peer device and is exchanging data; this state also processes how the device responds if disconnected. Lastly, the module enters the Shutdown State.

Back to Top

Procedure

Connect to BM71

Connect the BM71 PICtail to your PC via the USB connector (bottom-side of the board) using the supplied USB Cable. Ensure the jumpers J3, JP8, and J1 (all yellow in this photo) are set as shown:

BM71 PICtail connected ato the BM71 PICtail to your PC via the USB connector (bottom-side of the board) to PC

COM Port

Open the Device Manager window by going to the Start Menu > Control Panel > Hardware and Sound and then select Device Manager. Once open, check which COM Port has been assigned to the BM71 PICtail. In this case, it is COM18, please note that yours will probably be different.

Device Manager showing COM which Port has been assigned to the BM71 PICtail

Place the module in Test mode by setting SW7 in the ON position, then press SW5 (reset) to reset the module.

Module in Test mode:  Set SW7 in the ON position, then press SW5 (reset)

The module's basic operating mode (Test/Application) is sampled and established on a module reset condition. We recommend pressing the Reset (SW5) push-button whenever SW7 is first changed, or when you want to be sure that SW7 is sampled and applied by the module.

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

Back to Top


Launch the User Interface Configuration Tool

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

Immediately after launch, the Start Menu window will pop up. Before we can do anything with this tool, we must load a UI parameter table. One way to load the UI parameters is by using an existing UI text file.

Click on Load in the Start Menu window.

Load Button in the Start Menu window

Back to Top


Load Text File

Selecting Load Text File will open up another window. Choose the IS1871SF_102_BLEDK3_UI v100.132(BM71) default text file and click Open.

Select Load Text File Button . Choose the IS1871SF_102_BLEDK3_UI v100.132(BM71). Click Open.

Back to Top


Edit Text File

Once the text file has been loaded, the Edit button will be enabled. Click on Edit.

Edit button enabled. Click on Edit.

When you press the Edit button to start editing UI parameters, the Main Feature window will pop up. This window is where the user will select the target application. BLEDK3 supports all Bluetooth Low Energy (BLE) operations, while the Beacon mode is used for non-connectable advertising only. If BeaconThings is selected, the module will support both BLEDK and Beacon operations.

For the purposes of this demo, we will only select BLEDK 0x01: BM71 and then click OK.

Select BLEDK 0x01: BM71. Click OK

Back to Top


Device Name

The main dialog window opens up providing all the parameter options that we can change. The first setting we will change during this lab is the Name Fragment under Device Information. In this case, I chose to name the module "DeveloperHelp". This is the name that will be displayed in the scan results.

Name Fragment under Device Information

The Name Fragment identifier becomes the module's Generic Access Profile (GAP) Service Device Name characteristic.

Back to Top


Disable UART_RX_IND

Under UART Setting, next to UART RX_IND, select the pull-down to Disable this feature:

Select radio buitton to Disable UART_RX_IND

When enabled, this feature places the module into a lower power mode, shutting off its UART RX operation. The host MCU then needs to drive this pin high to enable subsequent packet I/O operations.

Back to Top


Save Settings

After we have changed the name of our BM71 module and disabled UART RX_IND, we need to write these new configuration settings into the module. Notice that Auto Pattern mode is selected by default; therefore we do not need to change that. Click on Finish.

Configuration settings tab. Click on Finish.

Back to Top


Write Settings

After that window closes, select Write on the Start Menu window that remains open.

It is useful to Save a UI Configuration file if you will use those certain settings repeatedly. You will save time by being able to load the text file instead of having to go back and edit all the settings from the default file.

Select Write button on the Start Menu window

On the window that pops up, select the COM Port that has been assigned to your BM71 PICtail (Step 1a). For Baudrate select 115200 and then click on Write.

Select the COM Port. Select 115200 for buadrateand. Click on Write.

Back to Top


Finish

You will see a window asking if you are sure you want to write to the EFLASH, select Yes.

To write to the EFLASH, select Yes.

Lastly you will see a window letting you know the write has been successful. Click on OK.

Select OK Button

You can now close the Start Menu window.

Back to Top


App Mode

Put the module in App mode by moving dip-switch SW7 to the OFF position and reset the module by pressing SW5 (the button immediately above the dip-switch).

Module placed in App mode.   Board view of moving dip-switch SW7 to the OFF position and pressing SW5

Back to Top


Smart Data App (iOS)

Open the Smart Data app and look for your device.

Smart Data app scanning for device

Tap on its name (in this case DeveloperHelp) and you will see Status: Connected.

Smart Data app connected

Back to Top


CoolTerm

The next step is to set up a CoolTerm serial port connection. In the accompanying image you will find the settings I used. Be sure to select the correct COM Port from Step 1a. The Baudrate should be 115200.

CoolTerm serial port connection settings

Back to Top


Send Data

You can now start exchanging data. Once you have typed your message on the app, press Send and you will immediately see it on the CoolTerm window.

Select Send to echo data to the CoolTerm window

As you are typing on the CoolTerm window, the message will appear on the Smart Data app.

Data entered in CoolTerm window seen on the Smart Data app

As you can see, whatever you type into the Smart Data app on the iOS device will show on the CoolTerm window and vice versa.

Back to Top


Smart Discover App (iOS and Android)

Launch the Smart Discover app on your smartphone and tap on your module's name to connect to it. The app will immediately list all the preloaded services on the module.

If you would like to see how the information found within the app can be useful, please visit the BM71 Generic Attribute Profile (GATT) Server Demo (Public Service) page

Smart Discover App Connected

Besides showing Status: Connected, you can verify you have established a link to your BM71 by taking a look at the PICtail itself. LED1 should be blinking twice every 1.5 seconds which is the default setting. The LED blink rate is something that you can customize using the UI Tool (see the accompanying image).

LED flash settings in UI Tool

If you have an Android phone or tablet, you can download the Smart Discover app (found in the "Software Tools" section above) and connect to your BM71 module that way.

Back to Top


Lastly, you can tap on Disconnect to drop the link between the smartphone and the BM71. LED1 will go back to flashing once every three seconds to show it is now on Standby mode. Again, this setting can be customized using the UI Tool.

Back to Top

Conclusions

In this lab you:

  • Worked with the Transparent UART Service built into the BM71 module.
  • Learned that LED1 on the BM71 PICtail can be customized to indicate what state the module is currently in.

Back to Top