HM-18-19 Datasheet PDF
HM-18-19 Datasheet PDF
HM-18-19 Datasheet PDF
CC2640R2 module
Datasheet
SIG members
acquisition module
---- Master and slave role in one
---- Remote control without external MCU
---- The PIO data acquisition without external MCU
13. Product parameters
2. Product overview
Thanks for you choose our products. If you want to know more,
www.jnhuamao.cn can help you (Videos, New version datasheet, Module work
flow, project Codes, etc.)
HM Bluetooth module use CC2640 IC, Master and slave roles in one,
transmission version and remote-control version in one, Support the AT
command modify module parameters, Convenient and flexible.
Transmission version can be used to transmit data between two Bluetooth
devices.
Remote Control version can be used to Control PIO ports output high or
low level without any other MCU.
HM-01, HM-02, HM-03, HM-04, HM-05, HM-06, HM-07, HM-08, HM-09 is
Bluetooth V2.1 version. Use CSR Chip.
HM-10, HM-11 is Bluetooth V4.0 BLE version. Use TI Chip.
HM-12, HM-13 is Bluetooth EDR 4.0 + BLE 4.0 dual mode.
HM-16, HM-17 is Bluetooth V4.2 BLE version. Use CC2640 Chip.
HM-18, HM-19 is Bluetooth V5.0 BLE version. Use CC2640 Chip.
HM-01, HM-09, HM-10, HM-12, HM-16, HM-18 have same size and same
pins.
HM-06, HM-07, HM-11, HM-13, HM-17, HM-19 have same size and same
pins.
3. Product model
Modules VDD Size(mm) Flash Chip BT Version
4. Product certificate
Most products have FCC-ID, CE, RoHS. You can download certification
from www.jnhuamao.cn or www.huamaosoft.com
15 NC NC NC
16 NC NC NC
17 NC NC NC
18 NC NC NC
19 NC NC NC
20 NC NC NC
21 GND Ground Ground
22 GND Ground Ground
23 PIO0 System Key PIN47
24 PIO1 System LED PIN48
25 PIO2 input/output pin. PIN49
26 PIO3 input/output pin PIN50
27 PIO4 input/output pin PIN51
28 PIO5 input/output pin PIN52
29 PIO6 input/output pin PIN53
30 PIO7 input/output pin PIN54
31 PIO8 input/output pin PIN5
32 PIO9 input/output pin PIN6
33 PIO10 input/output pin PIN7
34 PIO11 input/output pin PIN8
6.5 HM-19 Schematic
When the module is wait for a connect, you can send and receive AT
command through UART, after connect, you can send and receive AT
command through remote device, also you can send and receive serial
data to each other through UART.
In limited remote-control mode, module only support remote device to
read some value, such like AT+BAUD? you can get module UART
information, but you can’t modify it in Limited remote-control mode.
8 AT Commands
Factory default setting:
Name: HMSoft; Baud: 9600, N, 8, 1; Peripheral Role; transmit mode.
AT Command format:
Uppercase AT command format. string format, without any other
symbol. (e.g. \r or \n).
mode, you can send and receive data what you want to send.
D: 5000ms
E: 6000ms
F: 7000ms
Default: 9
Default: 0
The maximum 1285ms recommendations form the IOS system. That is to
say, 1285ms is apple allowed, but in response to scan and connected all the
time will be long.
4. Query/Set Advertising Type
Send Receive Parameter
AT+ADTY? OK+ Get:[P] None
AT+ADTY[P] OK+ Set:[P] P: 0 ~ 3
0: Advertising
ScanResponse,
Connectable
1: Only allow last device
connect in 1.28 seconds
2: Only allow Advertising
and ScanResponse.
3: Only allow Advertising
Default: 0
5. Query/Set Module pin output state, After connection is established
Send Receive Parameter
AT+AFTC? OK+ Get:[P] P: 0,1,2,3
AT+AFTC[P] OK+ Set:[P] Default: 0
8. Query/Set Characteristic
Send Receive Parameter
AT+CHAR? OK+Get:<P1> P1: 0x0001~0xFFFE
AT+CHAR<P1> OK+Set:<P1> Default: 0xFFE1
1: Update
Default: 1(update)
This command is only use when module is in slave role.
Note: This command is added since V116
14. Clear Last Connected device address
Send Receive Parameter
AT+CLEAR OK+CLEAR None
15. Try connect to last succeeded device
Send Receive Parameter
AT+CONNL OK+CONN<P1> Para1: L, E, F, N
L: Connecting
E: Connect error
F: Connect Fail
N: No Address
Notice: This command is used for central role. Must set up AT+IMME1 and
AT+ROLE1 first.
If remote device has already connected to other device or shutdown,
“OK+CONNF” will be receive after about 10 seconds.
16. Try to connect a address use array index after AT+DISC?
Send Receive Parameter
AT+CONN<P1> OK+CONN<P2> P1: 0~5
P2:
A: Connecting
E: Connect error
F: Connect Fail
Notice: Only Central role is used. Must set up AT+IMME1 and AT+ROLE1
first.
If remote device has already connected to other device or shutdown,
“OK+CONNF” will receive after about 10 seconds.
17. Try to connect a device use MAC address
Send Receive Parameter
AT+CO<P0><P1> OK+CO<P0><P0><P2> P0: N, 1
N: Normal Address
1: Random address
P1: Address
Like: 0017EA090909
P2: A, E, F
A: Connecting
E: Connect error
F: Connect Fail
Notice: Only central role is used. Must set up AT+IMME1 and AT+ROLE1
first.
P0 is device type, possible value is 0, 1, 2, could get from AT+DISC?
Command.
If remote device has already connected to other device or shut down,
“OK+CONNF” will received after about 10 Seconds.
e.g.
Try to connect a device which MAC address is 00:17: EA: 09:09:09
Send: AT+CON0017EA090909
May receive a reply:
OK+CONNA ========= Accept request, connecting
OK+CONNE ========= Connect error
OK+CONN ========= Connected, if AT+NOTI1 is setup
OK+CONNF ========= Connect Failed, After 10 seconds
If the device not enable iBeacon function, P0, P1, P2 will use ‘0’ to fill.
Default: B6444520
iBeacon UUID is: 74278BDA-B644-4520-8F0C-720EAF059935.
This command can change red color string in iBeacon UUID string.
e.g.: Send: AT+IBE112345678 to change iBeacon UUID string red color
part value to “12345678”
29. Query/Set iBeacon UUID
Send Receive Parameter
AT+IBE2? OK+Get:<P1> P1: 00000001~
AT+IBE2<P1> OK+Set:<P1> FFFFFFFE
Default: 8F0C720E
iBeacon UUID is: 74278BDA-B644-4520-8F0C-720EAF059935.
This command can change red color string in iBeacon UUID.
e.g.: Send: AT+IBE112345678 to change iBeacon UUID string red color
part value to “12345678”
30. Query/Set iBeacon UUID
Send Receive Parameter
AT+IBE3? OK+Get:<P1> P1: 00000001~
AT+IBE3<P1> OK+Set:<P1> FFFFFFFE
Default: AF059935
iBeacon UUID is: 74278BDA-B644-4520-8F0C-720EAF059935.
This command can change red color string in iBeacon UUID.
e.g.: Send: AT+IBE112345678 to change iBeacon UUID string red color
part value to “12345678”
31. Query/Set Module iBeacon Major version
Send Receive Parameter
AT+MARJ? OK+Get:<P1> P1: 0x0001~0xFFFE
AT+MARJ<P1> OK+Set:<P1> Default: 0xFFE0
0x0102
32. Query/Set Module iBeacon minor
Send Receive Parameter
AT+MINO? OK+Get:<P1> P1: 0x0001 ~ 0xFFFE
AT+MINO<P1> OK+Set:<P1> Default: 0xFFE1
Send: AT+NAMEbill_gates
Receive: OK+SetName:bill_gates
38. Query/Set Parity bit
Send Receive Parameter
Query: AT+PARI? OK+Get:<P1> P1: 0, 1, 2
Set: AT+PARI<P1> OK+Set:<P1> 0:None
1:EVEN
2:ODD
Default: 0 (None)
39. Query/Set PIO1 output status (System LED)
Send Receive Parameter
AT+PIO1? OK+Get:<P1> P1: 0, 1
AT+PIO1 <P1> OK+Set:<P1> 0: Unconnected Output
500ms High 500ms Low,
Connected output High.
1: Unconnected output
Low, Connected output
High.
Default: 0
40. Query/Set PIO pins output high or low (Only this time, when module next
power on, this value is not be used)
Send Receive Parameter
AT+PIO<P1>? OK+PIO:<P1><P2> P1: 2, 3
AT+PIO<P1><P2> OK+PIO:<P1><P2> P2: 0, 1, ?
P1 is which PIO pin you
want to Query/Set
P2: “0” is low, “1” is high
and “?” is query
e.g.
Query PIO2
Send: AT+PIO2?
Setup PIO2 output high
Send: AT+PIO21
Receive: OK+PIO21
HM-18 and HM-19 only PIO2, PIO3 can be used.
41. Query/Set Pin Code
Send Receive Parameter
AT+PASS? OK+Get:[P1] P1: 000000~999999
AT+PASS[P1] OK+Set:[P1] Default: 000000
e.g.
Query Pin Code
Send: AT+PASS?
Receive: OK+Get:000000
Setup Pin Code 008888
Send: AT+PASS008888
Receive: OK+Set:008888
Default: 0
48. Query Last Connected Device Address
Send Receive Parameter
AT+RADD? OK+RADD:MAC Address None
49. Query/Set BLE talk method
Send Receive Parameter
AT+RESP? OK+Get:<P1> None
AT+RESP<P1> OK+Set:<P1> Para1: 0, 1, 2
0: WriteWithoutResponse
1: Write
2: Both 0 and 1
Default: 0
50. Query/Set PIO0 function (System KEY)
Send Receive Parameter
AT+SYSK? OK+Get:[P1] P1: 0, 1
AT+SYSK[P1] OK+Set:[P1] 0: Only cancel operate,
1: When module is
standby, restore factory
setting.
Default: 1
51. Query/Set Stop bit
Send Receive Parameter
AT+STOP? OK+Get:<P1> P1: 0, 1
AT+STOP<P1> OK+Set:<P1> 0: One stop bit
1: Two stop bit
Default: 0 (One stop bit)
52. Set Module into sleep mode
Send Receive Parameter
AT+SLEEP OK+SLEEP None
1: Show name
Default: 0
If AT+SHOW1 is setup, AT+DISC? Command will show device name
information when the device has been found.
57. Query/Set Module Bond Mode
Send Receive Parameter
AT+TYPE? OK+Get:[P1] None
AT+TYPE[P1] OK+Set:[P1] P1: 0~2
0: Not need PIN Code
1: Auth not need PIN
2: Auth with PIN
3: Auth and bonded
Default: 0
Android system AT+TYPE1 is same to AT+TYPE2.
Added since V107.
58. Query/Set service UUID
Send Receive Parameter
AT+UUID? OK+Get:<P1> P1: 0x0001~0xFFFE
AT+UUID<P1> OK+Set:<P1> Default: 0xFFE0
Resource:
Bluetooth Module 2.1 datasheet:
http://www.jnhuamao.cn/Bluetooth_en.zip
Bluetooth Module 4.0 datasheet:
http://www.jnhuamao.cn/Bluetooth40_en.zip
Bluetooth Module 4.0 USB Dongle
http://www.jnhuamao.cn/HMDongle40_en.zip
Bluetooth 2.1 Com Assistant for android:
http://www.jnhuamao.cn/HMComAssistant.rar
Bluetooth 4.0 Com Assistant for android 4.3:
http://www.jnhuamao.cn/HMBLEComAssistant.rar
Bluetooth 4.0 IOS Code:
http://www.jnhuamao.cn/HMSoft_iso7.zip