2016 Microchip Technology Inc.
DS50002547A-page 27
3.7
READING SENSOR BOARD PERIPHERAL IO PORTS USING UART
COMMANDS
The RN4870/71 module has digital and analog peripheral inputs and outputs. For a
detailed description of the IO interfaces, refer to the
“RN4870/71 Bluetooth
®
4.2 Low
Energy Module Data Sheet”
(DS50002489), and for the configuration details, refer to
Section 2.4.24
and
Section 2.6.5
through
Section 2.6.8
of the
RN4870/71 Bluetooth
®
Low Energy Module User’s Guide”
(DS50002466). Peripheral IO can be accessed
through direct UART commands or over Bluetooth Low Energy connection by associ-
ating a GATT characteristic with a peripheral input or output.
In this section, UART commands are used to access peripheral IO on the Sensor board
connected to the RN4870 PICtail as illustrated in
1. Connect the Sensor board to the RN4870 PICtail as shown in
.
2. Set Factory Default to default Peripheral IO functions:
• Using Terminal Emulator, open the COM port to the RN4870 module
• Type
$$$
to enter Command mode
• Enter
SF,1
and verify that the module reboots after the command is
entered.
3. Type the following sequence of commands to set the RN4870 IO pin into the con-
figuration as illustrated in
:
• Type
$$$
to enter Command mode
• Enter
+
to enable local echo
• Enter
SW,01,00
for ADC input port 01 used by the light sensor
• Enter
SW,02,00
for ADC input port 02 used by the potentiometer
• Enter
SW,03,00
to configure digital IO port connected to the LED
• Enter
SW,04,09
to configure digital IO trigger connected to the push button
• Enter
SF,1
to reboot the module for the settings to take effect