2016 Microchip Technology Inc.
DS50002547A-page 41
5. Program the PIC32 with the
bm7x_configure_demo_xc32.hex
or the PIC24
with the
bm7x_configure_demo_xc16.hex
or the PIC18 with the
bm7x_-
configure_demo_xc8.hex
file in the
precompiled_hex
sub-directory.
6. Alternatively, open the
bm7x_configure_demo.X
MPLAB X workspace using
the MPLAB X IDE to compile and program; or enter Debug mode and select
either the PIC32, the PIC24 or the PIC18 workspace configuration based on the
hardware combination as shown in
FIGURE 5-3:
SELECT WORKSPACE CONFIGURATION
7. Change the
#define BMXX_DEVICE xyz
in main.c to
BM70_BLUETOOTH_DE-
VICE
to work with RN4870.
5.2.3
Connecting/Running Demo
After setting up the hardware combination and programming the PIC, perform the fol-
lowing the steps to run the demo:
1. Observe the RN4870/71 configuration by inserting break points into the work-
space or by optionally using the debug UART port.
2. Download and install the
BtChat_V1.0.3.apk
file on the Android device from
the BM7x PICtail Plus web page.
3. Open the BtChat application installed by the
BtChat_V1.0.3.apk
on the
Android device.
4. Scan for the Bluetooth devices on the Android app.
5. Select the BM7x device listed in the scan list and click to pair and connect.
6. The application uses Just Works pairing by default. If Passkey Entry or Passkey
Yes/No Confirm mode is selected, provide the passkey or confirmation using the
debug UART port. For the RN4870 module’s supported pairing modes, refer to
the
“ Bluetooth
®
Low Energy Module User’s Guide”
(DS50002466).
7. Once connected, the data can be transmitted from the RN4870/71 through the
debug UART port to the BtChat app over Bluetooth link.
8. Enable Show Rx Text option in the BtChat app setting. The BtChat app can
resend data to the RN4870/71 that is later received through the debug UART.