Smartphone Basic Demo (Transparent UART)

 Objective

This tutorial takes you through the steps needed to establish a Transparent UART connection using the Bluetooth Smart Data (SmartData) App.

 Materials

Hardware Tools

Software Tools

 Procedure

1

Jumpers

Make sure the following connections on the RN4870 PICtail are enabled.

a

J3: USB-UART Interface Connection
This jumper bank connects the RX, TX, RTS, and CTS signals from the module to the USB. Put the jumpers on the bottom two (TX and RX). The top two can be added based on your flow control preferences.

J3.png

b

JP8: P0_2 LED Display
Connect this one if you want to see the LED indication from the module; it is connected by default.

JP8.png

c

J1: Power Source Connector
This lab uses CoolTerm so make sure to connect the middle jumper labeled: USB.

J1.png

2

Connect RN4870 PICtail to PC

Connect the RN4870 PICtail to the PC via supplied USB cable.

Connected.png

3

Verify COM Port

Open the Device Manager window by going to the Start Menu -> Control Panel -> Hardware and Sound and then selecting Device Manager. Once open, check which COM Port has been assigned to the RN4870 PICtail board.

DeviceManager.png

4

Start a CoolTerm Connection

Launch CoolTerm and establish a connection with the following settings (your COM port might be different)

CoolTerm.png

5

Enable Transparent Service

Enter the following commands into your CoolTerm window:

$      // Enter Command Mode
+        // Turn Local Echo on
SS,C0    // Support Device Info and UART Transparent services  
R,1      // Reboot device for configuration to take effect

6

Smart Data App

On your Apple® device, go to the iTunes® App Store and install the SmartData App by Microchip Technology Inc.

SmartData.png

7

Launch the Smart Data App

After you open the Smart Data app on your smartphone, it will immediately scan for Bluetooth devices nearby. The default name for the RN4870 module (RN_BLE) should show up. Tap on it to connect to your RN4870 module.

ListOfDevices.png

On the CoolTerm window you will see the status message, %CONNECT,1,<MAC>%, returned by the RN4870 UART, indicating a connection has been established. The <MAC> address is the address of the remote device that initiated the connection. Next to it, you will also see the %STREAM_OPEN% indicating that the UART Transparent data pipe has been established. Once connected to another device, the RN4870/71 automatically enters Data Mode if the UART Transparent feature is enabled.

StreamOpen.png

Another message you might see is the %CONN_PARAM,<Interval>,<Latency>,<Timeout>% status message. This shows the connection interval, slave latency and supervision timeout parameters for the existing connection.

8

Send Data

You can now start exchanging data. Once you have typed your message on the app (Hello World!), press the Send button to transfer data from SmartData App to the RN4870 module which is received and printed on the serial terminal of the RN4870 UART (CoolTerm window).

SendingData.png

Type another message into the serial terminal of the RN4870 (How are you?) and you will see it is received and printed on the receive view of the SmartData app.

 Conclusions

In this lab you:

  • Added the Transparent UART Service to your RN4870 module
  • Sent and received data using Microchip's Transparent UART Service
© 2016 Microchip Technology, Inc.
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.