您好,欢迎来到飒榕旅游知识分享网。
搜索
您的当前位置:首页rn42-ek-1.0

rn42-ek-1.0

来源:飒榕旅游知识分享网
RN-4142-EK-UG

RN-41-EK & RN-42-EK Evaluation Kit User’s Guide

© 2012 Roving Networks. All rights reserved.RN-4142-EK-UG Version 1.0 12/10/12

Copyright © 2012 Roving Networks. All rights reserved. Roving Networks is a registered trademark of Roving Networks. Apple Inc., iPhone, iPad, iTunes, Made for iPhone are registered trademarks of Apple Computer. Roving Networks reserves the right to make corrections, modifications, and other changes to its products, documentation and services at any time. Customers should obtain the latest relevant information before plac-ing orders and should verify that such information is current and com-plete.

Roving Networks assumes no liability for applications assistance or cus-tomer’s product design. Customers are responsible for their products and applications that use Roving Networks components. To minimize cus-tomer product risks, customers should provide adequate design and oper-ating safeguards.

Roving Networks, Inc.102 Cooper CourtLos Gatos, CA 95032+1 (408) 395-5300

www.rovingnetworks.com

Roving Networks products are not authorized for use in safety-critical applications (such as life support) where a failure of the Roving Networks product would reasonably be expected to cause severe personal injury or death, unless officers of the parties have executed an agreement specifi-cally governing such use.

www.rovingnetworks.comVersion 1.0 12/10/12page 2

RN-4142-EK-UG

1.0OVERVIEW

This document describes the hardware and software setup for Roving Networks RN-41-EK andRN-42-EK evaluation boards. The RN-41-EK and RN-42-EK evaluation boards are field-ready,Bluetooth SIG qualified prototyping platforms for the RN41 and RN42 modules, respectively. Theboards have the flexibility to connect directly to PCs via a standard USB interface (via the FTDIchipset) or to embedded processors through the TTL UART interface. The status LEDs,dipswitches, and signal headers enable rapid prototyping and integration into existing systems.You configure and control the modules from a console with a simple ASCII command language.Once the configuration is set up, the module can connect over Bluetooth. You use the evaluationkit to configure the Bluetooth module using the command interface, create connections, andtransfer data. See “Resources & Related Documents” on page16 for information on availabledocumentation.

The RN-41-EK and RN-42-EK evaluation boards support the serial port profile (SPP) and humaninterface device (HID) profiles. The instructions in this document use the SPP profile. For moreinformation on these profiles and how to switch between them, refer to the Bluetooth CommandReference & Advanced Information User’s Guide.

2.0EVALUATION KIT DESCRIPTION

The evaluation kit includes the hardware required to connect the evaluation board to your com-puter. See Table2-1. To evaluate the module on the evaluation board, you need a computer witha USB port running the Microsoft Windows or Mac OS-X operating system.Note:

Before beginning your evaluation, you may need to install the FTDI driver for the USB cable. You can download the driver (as well as other tools and utilities) from the Roving Networks website at http://www.rovingnetworks.com/support.php.

TABLE 2-1:

Evaluation boardMini-USB cable

EVALUATION KIT CONTENTS

Description

Contains the Bluetooth module, status LEDs, and dipswitches.

Links your computer to the evaluation board.

Hardware

Figure2-1 describes the evaluation board’s interfaces and connectors.Table2-2 describes thestatus LEDs. The green LED indicates the status of the Bluetooth connection and when thedevice is in configuration mode. The RN41 and RN42 modules are pin compatiable; therefore,the description applies to both the RN-41-EK and RN-42-EK boards. Refer to “RN-41-EK &RN-42-EK Schematic” on page17 for the board’s schematic.

www.rovingnetworks.comVersion 1.0 12/10/12page 3

RN-4142-EK-UG

FIGURE 1-1:RN-41-EK & RN-42-EK EVALUATION BOARD, Note1GPIO SignalHeader 2 (J2)Pin 13TopPCB TraceAntennaUSBInterfaceLEDIndicators(S = GreenA = Red)ProgrammingHeader (J3)GPIO SignalHeader 1 (J1)BottomPCB TraceAntennaConfigurationSwitchesNote1:This figure shows the RN-42-EK board. The RN-41-EK board is similar.GPIO Signal Header 1 (J1)

123456789101112GPIO Signal Header 2 (J2)

131415161718192021222324Programing Header (J3)

123456Pin123456789101112

DescriptionGPIO6GPIO7RESET_NNo ConnectNo ConnectNo ConnectNo ConnectSensor Input 1 (AIO1)Shutdown (SHDN)No Connect3.3 VGND

Pin131415161718192021222324

DescriptionGPIO4GPIO3GPIO2CTSRTSTXDRXDGPIO11GPIO10GPIO9GPIO8

Sensor Input 0 (AIO0)

Pin123456

DescriptionSPI_MISOSPI_MOSISPI_SCKSPI_SS3.3 VGND

Configuration SwitchesSwitch1234

DescriptionRestore Factory DefaultsAutomatic DiscoveryAutomatic MasterDefault Baud Rate

www.rovingnetworks.comVersion 1.0 12/10/12page 4

RN-4142-EK-UG

TABLE 2-2:STATUS LEDS

Mode

Green LED (S)

Command mode

Boot up, remotely configurableDiscoverable/idleConnected

––

Data over the UART–

Red LED (A)

Fast blink, 10 times per secondBlinks twice per secondBlinks once per secondSolid on3.0HARDWARE SETUP

To set up the evaluation hardware, perform the following steps:1.

Connect the mini-USB cable to your computer’s USB port and to the evaluation board’smini-USB connector. This connection provides power to the board and provides a dataconnection to the command console. Note:

Windows prompts you to install the FTDI drivers (that create a virtual COM port to the module’s USB port) if they are not already installed. You can download the driv-ers from the Support page on the Roving Networks website at http://www.rovingnet-works.com/support.php.

2.Note the COM port to which you have attached the cable.

Figure3-1 shows the completed hardware setup for the evaluation boards.

FIGURE 1-2:COMPLETED HARDWARE SETUP

www.rovingnetworks.comVersion 1.0 12/10/12page 5

RN-4142-EK-UG

4.0USING THE EVALUATION KIT

You program Roving Networks Bluetooth devices over the Bluetooth link or through the serialinterface (USB port) using a simple ASCII command language, which is similar to the industry-standard Hayes AT protocol. set commands configure the module and get commands echo thecurrent configuration. Configuration settings modified with the set command do not take effectuntil the module has been rebooted, even though the get command may show otherwise.This section assumes that you have a working knowledge of Bluetooth operation and communi-cations. To configure the Roving Networks devices you need a Bluetooth-enabled PC (eitherbuilt-in or using a USB Bluetooth dongle). You can only configure one device at a time. Onceconfigured, device settings are saved (independent of power down) until they are explicitlychanged or the factory defaults are restored.Note:

For detailed information on the ASCII commands you use to configure the Bluetoothmodule, refer to the Bluetooth Command Reference & Advanced Information User’sGuide.

4.1Command Mode vs. Data Mode

The Bluetooth device operates in two modes: data mode (default) and command mode. Uponpower up the device is in data mode. While in data mode, the module is essentially a data pipe.When the module receives data from a remote Bluetooth device over a serial port profile (SPP)connection, it strips the Bluetooth headers and trailers and passes the user data to the UART.When data is written to the UART, the module constructs the Bluetooth packet and sends it outover the Bluetooth SPP connection. Thus, the entire process of sending/receiving data to thehost is transparent to the end microprocessor. See Figure1-1.

FIGURE 1-3:DATA & COMMAND MODES

Host

User DataA

B

UART$$$

Bluetooth

BluetoothModule

Bluetooth Interface

$$$

ABCommandMode

www.rovingnetworks.comVersion 1.0 12/10/12page 6

RN-4142-EK-UG

The default configuration for the Bluetooth device is:•••••

Bluetooth slave mode

Keyboard default authentication mode (no pin code required)Serial port 115,200 Kbps baud rate, 8 bits, no parity, 1 stop bitSerial port flow control disabledLow power mode off

You configure the device by putting it into command mode and sending ASCII commands overa serial port or the Bluetooth link. Once you change the configuration parameters, they persistuntil you change them or perform a factory reset.There are two ways to configure the Bluetooth module:•Local configuration using your computer’s USB port•Via Bluetooth

You need a terminal emulator to complete the setup.Note:

Suggested terminal emulator programs are TeraTerm (Windows OS) or CoolTerm(Mac OS-X).

4.2Configure the Module Locally Using the USB Port

Set up the RN-41-EK or RN-42-EK hardware as described in “Hardware Setup” on page5. Withthe Bluetooth device connected and powered on, run a terminal emulator and open the COM portto which the cable is connected. You should configure the virtual COM port connected to theRN-41-EK or RN-42-EK USB interface with the default settings (115,200 Kbps baud, no parity, 8bits, 1 stop bit).

You can use command mode through the UART interface via the USB connector at any timewhen the device does NOT have a Bluetooth connection, as well as under certain conditions. Ifthe device is in configuration mode and a connection occurs, the device exits configuration modeand data passes back and forth from the remote device. Note:

If the device is in Auto-Connect Master Mode, you cannot enter command modewhen connected over Bluetooth. See “Operating Modes” on page9 for more infor-mation on the various operating modes.

4.3Enter Command Mode

To enter command mode, launch a terminal emulator and specify the module’s default settings.Table4-1 shows the serial port settings.

TABLE 4-1:

PortBaud rateData ratePatiryStop bitsFlow control

SERIAL PORT SETTINGS

Setting

1152008 bitsNone1None

Value

COM port to which you attached the module

Type $$$ into the terminal emulator to enter command mode.

The module returns the string CMD, which indicates that your connection and terminal settingsare correct. While in command mode, the device accepts ASCII bytes as commands.

www.rovingnetworks.comVersion 1.0 12/10/12page 7

RN-4142-EK-UG

When you power up the module, you must enter command mode within a 60 second configura-tion window; otherwise, the module goes into fast data mode in which all characters are ignoredincluding $$$. If the configuration timer expires while the device is in command mode, the devicedoes not go into fast data mode after exiting command mode. When you enter a valid command,the module returns AOK. It returns ERR for an invalid command and ? for unrecognized com-mands. Type h to see a list of commands.

A quick check to confirm that you are in command mode is to type the X command afterentering command mode. This command shows the a summary of the module’s current settings,such as the Bluetooth name, device class, and serial port settings. See Figure1-2.To return to data mode, type --- or reset the device and re-connect.

FIGURE 1-4:VIEW CURRENT SETTINGS

www.rovingnetworks.comVersion 1.0 12/10/12page 8

RN-4142-EK-UG

4.4Operating Modes

The Bluetooth device has several operating modes, which you set using the SM command incommand mode.Note:

In all master modes, the device cannot be discovered or configured remotely overBluetooth.

•Slave Mode (SM,0)—Default mode, in which other Bluetooth devices can discover and connect to the device. You can also make outbound connections in this mode.•Master Mode (SM,1)—In this low-speed connection mode, the device 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 device to initiate connections (not receive them). In this mode, the device is NOT dis-coverable or connectable.•Trigger Mode (SM,2)—In this low-speed connection mode, the device makes connections automatically when a character is received on the serial port (UART). The connection con-tinues as long as characters are received on either end. The device has a configurable tim-eout (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 device makes connections automat-ically 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. If an address is not

stored, the device 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; there-fore, the connection cannot be broken via commands or software break characters. If a dis-connect occurs, the device attempts to re-connect until successful.•Auto-Connect DTR Mode (SM,4)—This mode must be set by command. It operates like Auto-Connect Master Mode, except that you control connection and disconnection with dipswitch 3. Turning the dipswitch on initiates the auto-connect process; turning the dipswitch off causes a disconnect. •Auto-Connect ANY Mode (SM,5)—This mode must be set by command. This mode oper-ates like Auto-Connect DTR Mode, except that each time the dipswitch 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 device attempts to connect with the remote device matching the store remote address. You set the remote address using the SR command.

www.rovingnetworks.comVersion 1.0 12/10/12page 9

RN-4142-EK-UG

4.5Configuration Switches

The evaluation boards have small configuration switches on the bottom. You need a paper clipor small screwdriver to flip them. Holding the board with the PCB antenna facing to the right, referto Figure1-3 for the switch numbering and on/off positions.

FIGURE 1-5:CONFIGURATION SWITCHESOff1234OnTable4-2 describes the functions controlled by the switches.

TABLE 4-2:

Switch1

CONFIGURATION SWITCH FUNCTIONS

Default (Off)

Do not restore factory defaults.

Description

Turn on the switch, power up the evaluation kit, and tog-gle the switch ON-OFF-ON-OFF-ON to return the mod-ule to its factory settings. The green (labeled as S) LED blinks quickly for a moment and then continues to blink about once per second.

In slave mode, this switch sets a special class of device that is used by the master to auto connect. If switch 3 also turned on, the module performs a search, stores, and connects to a remote Roving Networks Bluetooth device that has switch 2 turned on.

With this switch turned on, the module acts as Bluetooth master and auto-connects to a stored remote address. You must first set the Bluetooth address of the slave device using the SR command or using instant cable replacement settings.

FunctionRestore fac-tory defaults

2

Automatic dis-coveryAutomatic discovery is turned off.

3

Automatic master

Automatic master is turned off.

4

Default baud rate

With this switch turned off, the If this switch is turned on, the baud rate is 9600 and the default 115 K baud rate is over-module ignores the software configuration. ridden by software baud rate configuration commands.

www.rovingnetworks.comVersion 1.0 12/10/12page 10

RN-4142-EK-UG

4.6Making a Bluetooth Connection

By default, the Bluetooth module acts as a slave and the PC is the master. You connect to theBluetooth module using your computer’s Bluetooth device manager, which varies depending onthe operating system. Regardless of the operating system, the process is the same: discovery,pairing, and connecting.

4.6.1DISCOVERY

When you turn on the RN-41-EK or RN-42-EK, the green LED (labeled as S) blinks once per sec-ond and the module is discoverable. Open your PC’s Bluetooth device manager and choose toadd a new device. The Bluetooth device manager’s icon is located in the bottom right corner ofyour screen in the taskbar for Windows and in the upper right corner for Mac OS-X. The Bluetoothdevice manager displays a list of discoverable Bluetooth device. The board displays as Fire-Fly-XXXX, where XXXX are the last 2 bytes of the device’s Bluetooth address. See Figure1-4.

FIGURE 1-6:DISCOVERY - ADD A BLUETOOTH DEVICE

4.6.2PAIRING

To pair with the evaluation board, double-click the board’s name in the list. The firmware auto-matically stores up to 8 pairings from remote hosts in a first in, first out fashion. The evaluationboard’s default authentication mode is keyboard (no pin code required). However, most PCsrequire authentication and display a pin code. If you are using a Bluetooth USB dongle(e.g.,RN-USB-T), your PC prompts you to choose how you want to pair. Figure1-5 shows exam-ples of pairing with and without a pin code. Note:

If your PC displays a pin code and asks you to confirm if it is correct, choose Yes.

www.rovingnetworks.comVersion 1.0 12/10/12page 11

RN-4142-EK-UG

FIGURE 1-7:PAIRING - COMPARING PIN CODES & PAIRING OPTIONS

When the Bluetooth device manager completes pairing, it issues a message that the Bluetoothdevice is installed on COMX where COMX is unique to your computer. In some cases, the Blue-tooth device manager creates two COM ports; in this situation, only use the COM port labeledoutgoing. Figure1-6 shows example COM port settings.

FIGURE 1-8:PAIRING - BLUETOOTH COM PORT SETTINGS

www.rovingnetworks.comVersion 1.0 12/10/12page 12

RN-4142-EK-UG

If the remote Bluetooth device does not require authentication, a connection can occur withoutthe pairing process. However the Bluetooth specification requires that if either device involved inthe pairing process requires authentication, the other device must participate to ensure a securelink. Roving Networks modules default to an open mode, such that the module does NOT requireauthentication. See “Security Modes” on page15 for more information on using pass keys.The module may use simple secure pairing (SSP) if it is attempting to pair with devices that sup-port the Bluetooth specification version 2.1 + EDR. SSP does not require the user to rememberthe pin code, but it asks to confirm the 6-digit number if the device has a display capability.

4.6.3CONNECTING

In most cases, you connect from another device to the RN-41-EK or RN-42-EK as an outgoingBluetooth connection. You can also make an incoming connection in which the evaluation boardinitiates the connection to the remote device.

4.6.3.1Outgoing Connections

To establish an outgoing Bluetooth connection from a PC to the RN-41-EK or RN-42-EK board,open the module’s outgoing COM port from your application or a terminal emulator. When youestablish a connection by opening the COM port, the evaluation board’s green LED (labeled asS) goes on solid (not blinking) to indicate that the device is connected. The device remains con-nected until you close the COM port, remove power from the board, or terminate the connectionusing the K,1 command. Refer to the Bluetooth Command Reference & Advanced InformationUser’s Guide for more information on using commands.

Once connected, the device is in data mode allowing data to flow in both directions. The board’sred LED (labeled as A) blinks once per second when data is transferred over the UART. For con-figuration and programming, the device must be in command mode. See “Enter CommandMode” on page7 for more information.Note:

Only one client can connect to a slave device at a time. As a master, the device canmake multiple connections, but only in a point-to-point, serialized fashion. The RN41and RN42 modules do not currently support multi-point master mode.

4.6.3.2Incoming Connections

For an incoming connection you use the port specified in your Bluetooth settings as incoming(refer back to Figure1-6). The PC or host listens for an incoming connection from the remote Blu-etooth device, in this case the RN-41-EK or RN-42-EK. Perform the following steps to make inincoming connection.1.

You need the MAC address of the PC’s Bluetooth radio to connect from the RN-41-EK orRN-42-EK to the host PC. Open the PC’s Bluetooth advanced settings to find the MACaddress. See Figure1-7.

www.rovingnetworks.comVersion 1.0 12/10/12page 13

RN-4142-EK-UG

FIGURE 1-9:PC’S BLUETOOTH RADIO MAC ADDRESS

2.3.4.5.6.

Pair your evaluation board with the PC as described in “Pairing” on page11.

Open a terminal (called terminal A in this example) and connect it to the evaluation board’soutgoing COM port. You can run this terminal on the host PC or another computer.

Open a second terminal (called terminal B in this example) on the host PC to listen for theincoming Bluetooth connection using the incoming COM port number.

Type C, in terminal A to establish an SPP connection to the host PC.See Figure1-8 for an example connection.Try the following commands:•$$$ to enter command mode

•SO,% to enable status message to see connect/disconnect conditions•R,1 to reboot

•$$$ to re-enter command mode•+ to enable local echo

•C, to attempt a connection with a remote device

Characters you type in terminal B are sent over Bluetooth to the host PC and appear in ter-minal A. Any characters entered in terminal A are transmitted to terminal B.

7.To kill the connection, type the K,1 command in terminal B.

www.rovingnetworks.comVersion 1.0 12/10/12page 14

RN-4142-EK-UG

FIGURE 1-10:TERMINALS A & B

4.7Security Modes

The Bluetooth module supports authentication. If the local or remote Bluetooth device hasauthentication enabled, a pin code is required the first time a connection is attempted. The pincode is a series of numbers or characters from 1 to 16 characters in length. After you enter thepin code, the Bluetooth devices compare them. If they match, a link key is generated and stored.Usually, but not always, the remote device stores the link key. For subsequent connections, thedevices compare link keys. If they are correct, you do not need to re-enter the pin code. If the remote device is a PC or PDA, the user generally is prompted to enter this pin code. Toremove the stored link key on the remote device, you typically “unpair” or remove the device fromthe Bluetooth manager. You can change the pin code to remove the link key on the Bluetoothmodule, forcing a new pin code exchange to occur upon subsequent connection attempts.Note:

Only one master can connect to the Bluetooth module at a time.

www.rovingnetworks.comVersion 1.0 12/10/12page 15

RN-4142-EK-UG

5.0RESOURCES & RELATED DOCUMENTS

For more information, refer to the following sources:

•RN41/RN41N Class 1 Bluetooth Module Data Sheet•RN42/RN42N Class 2 Bluetooth Module Data Sheet

•Bluetooth Command Reference & Advanced Information User’s Guide

6.0

6.1

DOCUMENT REVISION HISTORY

Version 1.0

Initial release.

7.0ORDERING INFORMATION

Table7-1 provides ordering information for the evaluation kits.

TABLE 7-1:

RN-41-EKRN-42-EK

EVALUATION KIT ORDERING INFORMATION

Description

Evaluation kit for the RN41 (Class 1) Bluetooth module.Evaluation kit for the RN42 (Class 2) Bluetooth module.

Part Number

Go to http://www.rovingnetworks.com for current pricing and a list of distributors carrying RovingNetworks products.

www.rovingnetworks.comVersion 1.0 12/10/12page 16

RN-4142-EK-UG

APPENDIX A:RN-41-EK & RN-42-EK SCHEMATIC

Figure1-9 shows the schematic for the RN-42-EK evaluation board. The RN41 and RN42 mod-ules are pin compatible; therefore, the schematic applies to both boards.

FIGURE 1-11:

M1RN-41-EK & RN-42-EK SCHEMATIC

RN42 ModuleD1Green LED3.3V1SPI_MOSIPIO6PIO7RESET_NSPI_SCKPCM_CLKPCM_SYNCPCM_INPCM_OUT3.3V23456789101112GNDSPI_MOSIPIO6PIO7RESETSPI_SCKPCM_CLKPCM_SYNCPCM_INPCM_OUTVDDGNDSHIELDPIO11PIO10AIO1AIO0GNDGNDPIO9PIO8SPI_MISOSPI_CS#PIO4PIO5PIO3PIO2USB_D-USB_D+UART_CTSUART_RTSUART_TXUART_RX242322212019181716151413SPI_MISOSPI_SSPIO4PIO5PIO3PIO2PIO5R2470Connection StatusPIO8R3470D2Red LEDActivityCTSRTSTXDRXDC21uF3.3VU154VOUTGNDTC1185VINSHDN13SHDNR13k3VBUSBYP029353433323128302C11uFC6PIO10PIO11AIO1AIO0PIO8PIO9VBUSC4100nF19100nFC5100nF161VCCIOHEADER 1123456789101112J1RXDTXDCTSRTSR12R13R11R143k33k33k33k3VB2SHDN3.3V30TXD2RXD32RTS8CTS31DTR6DSR7DCD3RI22CBUS021CBUS110CBUS211CBUS39CBUS43V3OUTPIO6PIO7RESET_NPIO4PIO3PIO2CTSRTSTXDRXDPIO11PIO10PIO9PIO8VB1HEADER 2123456789101112J23.3VU3FT232RQ1514182728VBUSD_ND_PJ41VBUS2D-3D+5GNDVCCUSBDMUSBDPRESETOSCI20GND17GND4GND24AGND33THPADTESTMTAB6USB Mini BR10R9R8R73k33k33k33k31234PIO4PIO3PIO6PIO7OSCOS1R18300kAIO0R15300kJ3123456SPI MASTERAIO1R17100kR16100kSPI_MISOSPI_MOSISPI_SCKSPI_SS3.3Vwww.rovingnetworks.comVersion 1.0 12/10/12

26VB1VB2page 17

RN-4142-EK-UG

NOTES:

www.rovingnetworks.comVersion 1.0 12/10/12page 18

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- sarr.cn 版权所有

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务