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
- Bluetooth Smart Data App (iOS)
- Terminal Emulator
- Windows/MAC/Linux: CoolTerm
Procedure
1
Jumpers
Make sure the following connections on the RN4870 PICtail™ are enabled.
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
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.
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% message, 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.
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, (Hello World!), on the app, press the Send button to transfer data from SmartData app to the RN4870 module. The message is received and printed on the serial terminal of the RN4870 UART (CoolTerm window).
Type another message, (How are you?), into the serial terminal of the RN4870 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.