Modulo bluetooth

Solo disponible en BuenasTareas
  • Páginas : 16 (3907 palabras )
  • Descarga(s) : 0
  • Publicado : 14 de marzo de 2012
Leer documento completo
Vista previa del texto
HongKong Electronics
HHW-SPP Bluetooth

Module

AT Commands
The HHW-SPP Bluetooth module has 2 work modes: Commands response mode and auto connection mode. And in the auto connection mode, there are Master and Slave mode. When the module works in the auto connection mode, it will automatically connect the other Bluetooth devices with SPP protocols. When under the Commands response mode, itcan carry out the AT commands in this data sheet, user can send all the AT commands to the module to configure it. By controlling the PIO11 of the module, use can set the working mode of the module. The Pins that module will use: 1. PIO8, connect to LED shows the working status of the Bluetooth module. After power up, it will flash, and the flash time is different under different status. 2. PIO9connect to LED shows the success of the connection, after successfully pairing, it will light. 3. PIO11, control the module working mode, High=AT commands receiving mode(Commands response mode), Low or NC= Bluetooth module normally working.

Set the module working under Master mode:
1. PIO11 set High 2. Power up the module and using the AT commands receiving mode 3. Use the Hyper Terminalsoftware or other RS232 communication tools, set the baud rate at 38400, Data bit:8, Stop bit:1, No Parity and Flow control. 4. Send the “AT+ROLE=1\r\n”, if success, it will return with “OK\r\n”, the “\r\n” is “Enter” 5. PIO11 set to low, and re-power up, now the module is working as Master, and automatically search the slave modules, and setup the connection.

HongKong Electronics

HongKongElectronics
Command详细说明
(AT

Commands instruction(“\r\n” means “Enter”)

1. Test:
Command
AT

Response OK

Parameter None

2. Reboot:
Response Command
AT+RESET

Parameter None

OK

4. Get the version of module:
Command
AT+VERSION?

Response
+VERSION:< Param >

Parameter Param:Version

OK Example:
at+version?\r\n
+VERSION:1.0-20090818

OK

4.

Restore to default:Command
AT+ORGL

Response OK

Parameter None

Default: ①Equipment ID: 0 ②Search code:0x009e8b33 ③.Working role:Slave Mode ④.Connection mode:Specific Bluetooth module ⑤.RS232 configuration:Baud Rate—38400bits/s or 9600bits/s; Stop Bit:1;Parity:None None ⑥.Pair code:“1234” ⑦.Device name:"HHW-SPP-1800-2" 5. Get module Bluetooth address::
Parameter Command
AT+ADDR?

Response
+ADDR:Param:Module address

OK Bluetooth module address type:NAP: UAP : LAP(HEX) Example: Bluetooth module address: 12:34:56:ab:cd:ef

HongKong Electronics

HongKong Electronics
at+addr?\r\n
+ADDR:1234:56:abcdef

OK

6. Set/Search device name:
Command
AT+NAME= < Param > AT+NAME?

Response OK
1、+NAME:< Param >

Parameter Param:Bluetooth device name Default name:“HHW-SPP-1800-2”

OK2、FAIL Example:
AT+NAME=HHW-SPP-1800-2\r\n —————Set device name for:“HHW-SPP-1800-2”

OK
AT + NAME=“HHW-SPP-1800-2”\r\n —————Set device name for:“HHW-SPP-1800-2”

OK
at + name = Beijin\r\n —————Set device name for:“Beijin”

OK at + name =“Beijin”\r\n OK
at+name?\r\n +NAME: Beijin

—————Set device name for:“Beijin”

OK

7. Get the remote Bluetooth device name:
Command
AT+RNAME?Response
1、+RNAME:

Parameter Param1:Remote device address Param2:Remote device name

OK 2、FAIL 蓝牙地址表示方法:NAP: UAP : LAP(十六进制) Example: The remote Bluetooth address is:00:02:72:0d:22:24,name:Bluetooth
at+rname? 0002,72,0d2224\r\n

+RNAME:Bluetooth

OK

8.

Set/enquire module role:
Command
AT+ROLE=< Param > AT+ROLE?

Response OK
+ROLE: < Param >

Parameter Param:Parameter取值如下: 0——Slave 1 ——Master
2 —— Slave-Loop

OK

Default:0 Slave———Passive connection; Slave-Loop ———Get the Bluetooth data and send them back to the sender ;

HongKong Electronics

HongKong Electronics

9.

Set/enquire -devices:
Command
AT+CLASS=< Param > AT+CLASS?

Response OK
1、+CLASS: < Param >

Parameter Param:Device Default:0

OK ——成功 2、FAIL ——失败

To filter other Bluetooth...
tracking img