Emartee CuteDigi BMX Bluetooth to UART/I2C/USB Module (GEN II) CuteDigi BMX Bluetooth to UART module uses CSR BlueCore4- External chipsets. It embeds 8Mbit flash for software storage, and supports 3.3V power supply. BMX is a muti-function module. It can be used in different products according to the embedded firmware settings. It is especially targeted for data transfer. The second generation Bluetooth UART module has two working mode: AT command mode, and automatic binding transparent data mode.
Other pins used by Bluetooth UART module: 1. PIO8 is used to control LED indicating the status. It will blink after power on. Different blink intervals are used to indicate different status. 2. PIO9 is used to control LED indicating paring. It will be steady on when paring is successful. 3. PIO11 is used to switch the working mode. High level-> AT command mode; Floating or low level-> normal transparent data mode. 4. The module has built-in power on reset circuitry.
Steps to configure the module as master device: 1. PIO11 is set to high. 2. Power on, and the module will enter into AT command mode. 3. Use hyper terminal or other serial console, set baud rate 38400, data 8 bit, stop bit 1, no parity, no flow control. 4. Send “AT+ROLE=1\r\n”, if successful, it will return “OK\r\n”. 5. PIO is set to low, and power cycle, the module will be master device and automatically search for slave device and do binding.
AT Commands (AT commands can be upper or lower case, and also end with \r\n) #1 : Test Comamnd Return OK Argument NONE Command Return AT+RESET OK Results: It works as power cycle. Argument NONE Command AT #2 : Reset #3: Poll the software version Command AT+VERSION? Return +VERSION:
#5: Poll the address of the Bluetooth device Command AT+ADDR? Return +ADDR: OK Argument Param: the address of the Bluetooth device Representation of the address: NAP:UAP:LAP (HEX) Examples: The address of the Bluetooth device is: 12:34:56:ab:cd:ef At+addr?\r\n +ADDR:1234:56:abcdef OK #6: Set and poll device name Command AT+NAME= AT+NAME? Return OK 1: +NAME: OK --- successful 2: FAIL --- fail Argument Param: device name Default: “HHW-SPP-18002” Example: AT+NAME=HHW-SPP-1800-2\r\
#7: Poll remote device name Command AT+RNAME? Return Argument 1: +RNAME: Param1: remote device address OK --- successful Param2: remote device name 2: FAIL --- fail Representation of the address: NAP:UAP:LAP (HEX) Examples: The address of the remote Bluetooth device is: 00:02:72:od:22:24, the device name is: Bluetooth t+rname? 0002,72,0d2224\r\n +RNAMELBluetooth OK #8: Set/Poll device role Command AT+ROLE= Return OK Argument Param: 0 – slave 1 – Master 2 – Slave-loop Default:
#10: Set/Poll Inquire Access Code Command AT+IAC= AT+IAC? Return 1: OK 2: FAIL +IAC: OK Argument Param: Inquire Access Code Default: 938b33 Detailed explanation can be found the appendix. If the inquire access code is set to GIAC(General Inquire Access Code: 0x9e8b33), it can be used to discover or be discovered by all nearby devices. If user wants the device to be able to be found quickly, user can set the Inquire Access Code to be code not as GIAC and LIAC, such as 0x928b3f.
#12: Set and poll paring password Command AT+PSWD= AT+PSWD? Return OK +PSWD: OK Argument Param: paring password Default: “1234” #14: Set and poll serial port parameters Command AT+UART=,, AT+UART? Return OK +UART:,,< Param3> OK Argument Param1: baud rate (bits/s) 4800 9600 19200 38400 57600 115200 230400 460800 912600 1382400 Param2: stop bit 0- 1 bit 1- 2 bits Param3: parity bit 0- None 1- Odd 2- Even Default: 9600,0,0 Example: Set serial port
#14: Set and poll connection mode Command AT+CMODE= Return OK AT+CMODE? +CMODE:: OK Argument Param: 0 – specific address mode (the address is specified in binding command) 2- No specific address Default: 0 #15: Set and poll binding device address Command AT+BIND= Return OK Argument Param – Binding Bluetooth device address AT+BIND? +BIND: OK Default address: 00:00:00:00:00:00 The address can be represented as NAP:UAP:LAP (hex) The binding command is only valid in specif
PI08 drives the working status, and PI09 drives the link status. Example: PI08 outputs low level to turn on LED, and PI09 outputs high level to turn on LED. AT+POLAR=0,1 \r\n OK AT+POLAR?\r\n +POLAR:0,1 OK #17: Set single PIO output Command AT+PIO=, Return OK Argument Param1: PIO port number (decimal) Param2L PIO port output 0- Low voltage 1- High voltage The useable port is PIO2- PIO7 and PIO10. Example: 1. PIO10 outputs high level AT+PIO=10,1\r\n OK 2.
#19: Poll PIO port input Command AT+MPIO? Return +MPIO: OK Argument Param- PIO port value (16 bits) Param[0]=PIO0 Param[1]=PIO1 Paramp2]=PIO2 … Param[10]=PIO10 Param[11]=PIO11 #20:Set/Poll Inquiry parameters Command Return AT+IPSCAN=,, OK , AT+IPSCAN? +IPSCAN:, ,, Argument Param1: inquiry time interval Param2:continous poll time Param3: call time interval Param4: call continuous time All above are decimal numbers Default: 1024, 51
#22: Set/Poll Security and Encryption modes Command AT+SENM=, AT+SENM? Return 1: OK 2:FAIL +SENM:, OK Argument Param1: Security mode 0- Sec_mode0_off 1- Sec_mode1_non-secure 2- Sec_mode2_service 3- Sec_mode3_link 4- Sec_mod_unknown Param2:encryption mode 0- hci_enc_mode_off 1- hci_enc_mode_pt_to_pt 2- hci_enc_mode_pt_to_pt_ and_bcast Default: 0,0 #23: Delete Authenticated Device from the authenticated device list Command AT+RMSAD= Return OK Argument Param: Blueto
#25: Locate Authenticated Device from the authenticated device list Command AT+FSAD= Return 1. OK - exists 2.
#29: Initialise the spp profile lib Command AT+INIT Return 1. OK 2. FAIL Argument NONE #30: Inquire nearby devices Command AT+INQ Return +INQ: ,, ….
#32: Device pairing Command AT+PAIR=, Return 1. OK 2. FAIL Argument Param1: remote device address Param2:timeout Example: Pair with remote device: 12:34:56:ab:cd:ef, timeout 20 s. At+pair=1234,56,abcdef, 20\r\n OK #33: Device Connection Command AT+LINK= Return 1. OK 2.
Appendix 1: AT command error ERROR code decoder Error_code (hex) 0 1 2 3 Explanation AT command error The result is default value PSKEY write error Device name is too long (more than 32 bytes) Device name is 0 byte Bluetooth address: NAP is too long Bluetooth address: UAP is too long Bluetooth address: LAP is too long PIO port mask length is 0 Invalid PIO port Device class is 0 byte Device class is too long Inquire Access Code length is 0 Inquire Access Code is too long Invalid Inquire Access Code Pairing
Appendix 2: Device Class The Class of Device/Service(CoD)is a 32 bits number that is made of 3 fields. One field specifies the service supported by the device. Another field specifies the major device class, which broadly corresponds to the type of the device. The third field specifies the minor device class, which describes the device type in more detail. The Class of Device/Service (CoD) field has a variable format. The format is indicated using the 'Format Type field' within the CoD.
1. MAJOR SERVICE CLASSES Bit no 13 14 15 16 17 18 19 20 21 Major Service Class Limited Discoverable Mode [Ref #1] (reserved) (reserved) Positioning (Location identification) Networking (LAN, Ad hoc, ...) Rendering (Printing, Speaker, ...) Capturing (Scanner, Microphone, ...) Object Transfer (v-Inbox, v-Folder, ...) Audio (Speaker, Microphone, Headset service, ...) Telephony (Cordless telephony, Modem, Headset service, ...) Information (WEB-server, WAPserver, ...) TABLE 1.
3. THE MINOR DEVICE CLASS FIELD The 'Minor Device Class field' (bits 7 to 2 in the CoD), are to be interpreted only in the context of the Major Device Class (but independent of the Service Class field). Thus the meaning of the bits may change, depending on the value of the 'Major Device Class field'. When the Minor Device Class field indicates a device class, then the primary device class should be reported, e.g.
1 1 0 83 - 99% utilized 1 1 1 No service available [REF #3] X X X All other values reserved TABLE 1.6: THE LAN/NETWORK ACCESS POINT LOAD FACTOR FIELD [Ref #3: "Device is fully utilized and cannot accept additional connections at this time, please retry later"] The exact loading formula is not standardized. It is up to each LAN/Network Access Point implementation to determine what internal conditions to report as a utilization percentage.
0 1 0 0 1 X X X X X 0 X Gaming/Toy [Ref #4] All other values reserved [Ref #4: Only to be used with a Gaming/Toy device that makes audio/video capabilities available via Bluetooth] TABLE 1.8: SUB DEVICE CLASSES FOR THE 'AUDIO/VIDEO' MAJOR CLASS 8. MINOR DEVICE CLASS FIELD - PERIPHERAL MAJOR CLASS 7 0 1 1 X 6 1 0 1 X Minor Device Class bit no of CoD Keyboard Pointing device Combo keyboard/pointing device All other values reserved TABLE 1.
7 X X X 1 X 6 X X 1 X X 5 X 1 X X X 4 1 X X X X Minor Device Class bit no of CoD Display Camera Scanner Printer All other values reserved TABLE 1.11: THE IMAGING MAJOR CLASS BITS 4 TO 7 Bits 4 to 7 independantly specify display, camera, scanner or printer. These may be combined in a multifunctional device. 3 0 X 2 0 X Minor Device Class bit no of CoD Uncategorized, default All other values reserved TABLE 1.
Appendix 3 The Inquiry Access Codes The General- and Device-Specific Inquiry Access Codes (DIACs) The Inquiry Access Code is the first level of filtering when finding Bluetooth devices and services. The main purpose of defining multiple IACs is to limit the number of responses that are received when scanning devices within range.