User Guide RN24, RN25, RN41, RN42, RN41XV, RN42XV, RN220XP, RN240, RN270, RN274 (Microchip) - 10

ManufacturerMicrochip
DescriptionRN-BT-DATA-UG Bluetooth Data Module Command Reference & Advanced Information
Pages / Page83 / 10 — RN-BT-DATA-UG. 1.4. OPERATING MODES. Note:
File Format / SizePDF / 1.4 Mb
Document LanguageEnglish

RN-BT-DATA-UG. 1.4. OPERATING MODES. Note:

RN-BT-DATA-UG 1.4 OPERATING MODES Note:

Model Line for this Datasheet

Text Version of Document

RN-BT-DATA-UG 1.4 OPERATING MODES
The Bluetooth module has several operating modes, which you set using the SM com- mand in command mode.
Note:
In all master modes, the module cannot be discovered or configured remotely over Bluetooth. • Slave Mode (SM,0)—Default mode, in which other Bluetooth devices can discover and connect to the module. You can also make outbound connections in this mode. • Master Mode (SM,1)—In this low-speed connection mode, the module makes connections when a connect command (C) is received. This command can also contain the Bluetooth address of the remote device. If a device is not specified, the module uses the stored remote address. The connection can be broken if the special break character or string is sent (use the SO command to set the break character). This mode is useful when you want the module to initiate connections (not receive them). In this mode, the module is NOT discoverable or connectable. • Trigger Mode (SM,2)—In this low-speed connection mode, the module makes connections automatically when a character is received on the serial port (UART). The connection continues as long as characters are received on either end. The module has a configurable timeout (which you set using the ST command) that disconnects the module after the specified number of seconds of inactivity (1 to 255) or a configurable break character is received. • Auto-Connect Master Mode (SM,3)—In this mode, the module makes connec- tions automatically on power-up and re-connects when the connection is lost. This mode can be set by command, or by setting the external dipswitch 3 during power up (evaluation kits) or by driving GPIO6 high (Bluetooth modules). If an address is not stored, the module performs an inquiry process and the first device found that matches the COD is stored. In this mode, high-speed data is passed without being interpreted; therefore, the connection cannot be broken via commands or soft- ware break characters. If a disconnect occurs, the module attempts to re-connect until successful. • Auto-Connect DTR Mode (SM,4)—This mode must be set by command. It oper- ates like Auto-Connect Master Mode, except that you control connection and dis- connection with dipswitch 3 (evaluation kits) and GPIO6 (Bluetooth modules). Turning the dipswitch on or driving GPIO6 high initiates the auto-connect process; turning the dipswitch off or driving GPIO6 low causes a disconnect. • Auto-Connect ANY Mode (SM,5)—This mode must be set by command. This mode operates like Auto-Connect DTR Mode, except that each time the dipswitch or GPIO is set, an inquiry is performed and the first device found is connected. The stored address is NOT used, and the address found is never stored. • Pairing Mode (SM,6)—In this mode, the module attempts to connect with the remote device matching the store remote address. You set the remote address using the SR command. www.rovingnetworks.com Version 1.0r 3/26/13 page 10 Advanced Information Document Outline Chapter 1. Introduction 1.1 Overview 1.2 Evaluation Boards & Reference Designs 1.3 Command Mode vs. Data Mode Figure 1-1: Data & Command Modes 1.3.1 Configuring the Module over the UART Port 1.3.2 Remote Configuration Using Bluetooth 1.3.3 Enter Command Mode Table 1-1: Serial Port Settings Figure 1-2: View Current Settings 1.4 Operating Modes 1.5 Using Dipswitches & GPIO Pins for Configuration Table 1-2: Dipswitch & GPIO Settings Table 1-3: GPIO Assignments 1.6 Making a Bluetooth Connection 1.6.1 Discovery Figure 1-3: Discover the Bluetooth Module 1.6.2 Pairing Figure 1-4: Pair with the Bluetooth Module Figure 1-5: Bluetooth COM Port Settings 1.6.2.1 Pairing with a Computer or Smart Phone 1.6.3 Connecting Figure 1-6: PC’s Bluetooth Radio MAC Address Figure 1-7: Terminals A & B 1.6.4 Security Modes Chapter 2. Command Reference 2.1 Command Syntax Table 2-1: Command Types 2.2 SET Commands 2.2.1 S7,<flag> Table 2-2: 7-Bit Data Mode Values 2.2.2 SA,<value> Table 2-3: Set Authentication Values 2.2.3 SB,<value> Table 2-4: Set Break Values 2.2.4 SC,<value> 2.2.5 SD,<value> 2.2.6 SE,<value> 2.2.6.1 Firmware version 5.40 & Higher 2.2.6.2 Firmware Prior to Version 5.40 Table 2-5: Set Encryption Enable 2.2.7 SF,1 2.2.8 SH,<value> Table 2-6: HID Flag Register Bits 2.2.9 SI,<hex value> 2.2.10 SJ,<hex value> 2.2.11 SL,<char> Table 2-7: UART Parity Values 2.2.12 SM,<value> Table 2-8: Mode Values 2.2.13 SN,<string> 2.2.14 SO,<string> 2.2.15 SP,<string> 2.2.16 SQ,<mask> Table 2-9: Special Configuration Settings Values 2.2.17 SR,<hex value> 2.2.18 SS,<string> 2.2.19 ST,<value> Table 2-10: Configuraion Timer Settings 2.2.20 SU,<value> 2.2.21 SW,<value> 2.2.22 SX,<flag> Table 2-11: Bonding Values 2.2.23 SY,<hex value> Table 2-12: Power Settings (August 2012 and Later) Table 2-13: Power table (before August 2012) 2.2.24 SZ,<value> 2.2.25 S~,<value> Table 2-14: Profile Values 2.2.26 S-,<string> 2.2.27 S?,<flag> Table 2-15: Role Switch Values 2.2.28 S$,<char> 2.2.29 S|,<value> 2.3 GET Commands 2.3.1 D 2.3.2 E 2.3.3 GB 2.3.4 GF 2.3.5 GK 2.3.6 GR 2.3.7 G& 2.3.8 G<char> 2.4 Change & Action Commands 2.4.1 $$$ 2.4.2 --- 2.4.3 + 2.4.4 & 2.4.5 C 2.4.6 C,<address> 2.4.7 CF,<address> 2.4.8 CFI 2.4.9 CFR 2.4.10 CT,<address>,<value> 2.4.11 F,1 2.4.12 H 2.4.13 I,<value 1>,<value 2> 2.4.14 IN<value 1>,< value 2> 2.4.15 IQ 2.4.16 IS<value> 2.4.17 IR<value> 2.4.18 J 2.4.19 K, 2.4.20 L 2.4.21 M 2.4.22 O 2.4.23 P,<char> 2.4.24 Q 2.4.25 R,1 2.4.26 T,<flag> Table 2-16: T Command Values 2.4.27 U,<value 1>,<value 2> 2.4.28 V 2.4.29 W 2.4.30 Z 2.5 GPIO Commands 2.5.1 S@,<hex value> 2.5.2 S&,<hex value> 2.5.3 S%,<hex value> 2.5.4 S^,<hex value> 2.5.5 S*,<hex value> 2.5.6 Controlling the GPIO Pins 2.5.7 Setting GPIO Pin Power-Up Values 2.5.8 Setting GPIO8, GPIO9, GPIO10 & GPIO11 Chapter 3. Advanced Topics 3.1 Power Management Table 3-1: Power Management Methods 3.1.1 Optimizing Inquiry (Discovery) & Page (Connection) Windows 3.1.2 Sniff Mode 3.1.3 Enabling Deep Sleep 3.1.4 Disabling Output Drivers 3.1.5 Lowering Transmit Power Table 3-2: Power Settings 3.2 Configuration Timer Settings Table 3-3: Configuration Timer Settings 3.3 Interfacing to a Microprocessor 3.3.0.1 How do I know the module is ready for command mode? 3.3.0.2 Which hard signals should I connect? 3.4 HCI Mode 3.4.1 HCI over UART 3.4.2 HCI over USB 3.5 Profile Settings & Features Table 3-4: Profile Change Values 3.6 Using GPIO Pins as Modem Control Signals 3.7 Design Concerns 3.7.1 Hardware Signals 3.7.1.1 Reset Circuit 3.7.1.2 Factory Reset GPIO4 3.7.1.3 Connection Status Table 3-5: GPIO5 Status Table 3-6: GPIO2 Status 3.7.1.4 Using the SPI Bus for Flash Upgrades 3.7.1.5 Hardware Connections & Power 3.7.2 LED Status Table 3-7: Green LED Status 3.7.3 Optimizing for Latency or Throughput 3.7.4 Limitations of 7-Bit Data Mode 3.7.5 Common Issues 3.7.5.1 My Bluetooth client can see the FireFly module and its serial service, but I can’t connect 3.7.5.2 How do I change the client’s COM port? 3.7.5.3 How do I connect to more than one FireFly module from the same client at the same time? 3.7.6 Discovery & Connection Example Sequence 3.7.7 Auto-Pairing/Auto-Connection Table 3-8: GPIO Pin/Dipswitch Settings for Auto-Pairing/Connection 3.8 Serial Adapter Configuration Figure 3-1: DB9 Connector Pins Table 3-9: DB9 Connector Pin-Out 3.9 Null Modem & Flow Control Jumpers Figure 3-2: RN422, RN240, RN270 & RN274 Jumpers Figure 3-3: RN220XP Jumpers 3.10 Dipswitch Settings Figure 3-4: DipSwitches Table 3-10: Switch Functions Chapter 4. Applications 4.1 Instant Cable Replacement 4.1.1 Hardware Pairing Using Dipswitches Figure 4-1: Cable Replacement DipSwitch Settings for Pairing Figure 4-2: Setting DipSwitch 2 for Deployment 4.1.2 Software Pairing Using Commands Chapter 5. HID Profile 5.1 Overview Figure 5-1: Typical HID Environments 5.2 HID Firmware Overview 5.2.1 Operational Modes 5.2.2 Profile Configuration 5.2.3 Device Discovery & Pairing 5.2.4 HID Flag Register Table 5-1: HID Flag Register Bits 5.2.4.1 Bit 9 5.2.4.2 Bit 8 5.2.4.3 Bits 7-4 5.2.4.4 Bit 3 5.2.4.5 Bits 2-0 5.3 HID Reports Table 5-2: Data Interpretation 5.3.1 Translation Mode 5.3.2 Keyboard Shorthand Mode 5.3.3 Raw Report Mode 5.3.4 Special Reports & Modes 5.3.4.1 Output Reports Table 5-3: Status Byte Definitions 5.3.4.2 Apple Virtual Keyboard 5.3.4.3 Key Map Register 5.3.4.4 Disconnect Key 5.3.4.5 Consumer Report Table 5-4: Data Byte Format 5.3.4.6 Scan Code Tables: UART (ASCII) to HID Report Table 5-5: UART-to-HID Scan Code Table 5-6: ASCII to HID Report (to Host) Scan Codes 5.4 HID References Appendix A. Factory Defaults Table A-1: Factory Default Settings Appendix B. Command Quick Reference Guide Table B-1: Set Commands Table B-2: Get (Display) Commands Table B-3: Action Commands (Part 1 of 2) Table B-4: GPIO Commands Appendix C. Firmware Revision History C.1 Version 6.15 (3/26/2013) C.2 Version 6.12 (Limited Release) C.3 Version 6.11 C.4 Version 6.10 C.4.1 HID Firmware Known Issues C.5 Version 4.77 (8/10/2009) C.6 Version 4.74 (3/7/2009) Appendix D. Document Information Conventions Used in this Guide Recommended Reading Document Revision History