1. The document provides instructions for debugging and setting up communication between Bluetooth modules using AT commands via UART. Key steps include resetting to factory defaults, setting a main and slave module, clearing memory to replace slave modules, and observing indicators and return values to ensure successful connection.
2. Debugging and setting up the modules requires issuing AT commands to reset, assign roles, clear memory, connect, and check for connection status. Proper powering and timing between commands is also important.
3. Specialized AT commands exist for functions like collecting battery level, temperature/humidity, outputting signals, and controlling the modules from a smartphone. However, some commands only apply to certain Bluetooth module models.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
40 views3 pages
How To Debug UART by Using AT Instruction
1. The document provides instructions for debugging and setting up communication between Bluetooth modules using AT commands via UART. Key steps include resetting to factory defaults, setting a main and slave module, clearing memory to replace slave modules, and observing indicators and return values to ensure successful connection.
2. Debugging and setting up the modules requires issuing AT commands to reset, assign roles, clear memory, connect, and check for connection status. Proper powering and timing between commands is also important.
3. Specialized AT commands exist for functions like collecting battery level, temperature/humidity, outputting signals, and controlling the modules from a smartphone. However, some commands only apply to certain Bluetooth module models.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3
1.
How to debug UART by using AT instruction
1.1 Every single Bluetooth module have to be wrote in some debugging-code via URAT before leaving factory, which means the UART have checked already to ensure leaving factory without any problem. However, if any problem does occur, please never doubt the functional problem of the UART. We absolutely assure the products are 100% high qualified. 1.2 TTL is used as the Bluetooth module UART level. If you connect it with a computer, please use the level converter chip RS232 as the or use any corresponding circuit. 1.3 It is not necessary to input any line feed, after you sending order ‘AT’. Some UART assistant sometimes provide the ’sending line feed’ option, you can delete or ignore this order option directly. 1.4 The reason why it is not necessary to input the ‘line feed’, because the receiving and sending data is normally fixed length, which means the line feed is redundant. 1.5 When the Bluetooth module under the non-resting state, the ‘AT’ command only can be used. 1.6 All the commands above, please set according to the Bluetooth module manual which apply to HM-15. Additionally, HM-15 module should be plugged and unplugged while you are setting some commands.
2. How to set the communication between two Bluetooth
modules. The communication between two Bluetooth modules is based on the good matching of main device and slave device, which means the devices should be set up into one main device and one slave device. Before you set up these two Bluetooth modules, please check the two modules are both power-on, and also please make sure nothing else devices are working at the same time. Meanwhile, all setting parameters can be saved automagically after you set up just once. 2.1 Slave module side: 2.1.1 AT+RENEW à Reset to factory defaults to avoid the incorrect settings. (this is an optional step) 2.2 Main module side 2.2.1 AT+RENEW à Reset to factory defaults to avoid the incorrect settings. (this is an optional step) 2.2.2 AT+ROLE1àSet as main module. After completing this command, HM-15 should be plugged in and unplugged out. 2.2.3 Wait for 10 seconds, keep observing until the LED indicator is normal. Two modules have been connected successfully. 3. How to replace slave module 3.1 Please under the main module side to execute command: 3.1.1 AT+CLEARàClear all memory address information. The main module can automagically search and try to connect new slave modules again.
4. How to replace main module
4.1 Please under the new main module side to execute command: 4.1.1 AT+RENEW 4.1.2 AT+ ROLE1àAfter completing this command, HM-15 should be plugged in and unplugged out.
5. How to make sure whether two modules successfully establish
a remote connection or not without observing the indicator state 5.1.1 AT+NOTI
6. How to make MCU determine that whether the modules
connected or not 6.1.1 AT+PIO
7. How to make main module working under the manual working
mode 7.1 All the working mode above are automatic working mode. The manual working mode process shown as following 7.1.1 AT+RENEW 7.1.2 AT+IMME1 7.1.3 AT+ROLE1à After completing this command, HM-15 should be plugged in and unplugged out. 7.1.4 AT+DISC? à If any device has been found, it would return to the device list automagically. 7.1.5 AT+CON[mac]à Connect device by using mac address.
8. How to set up the transparent transmission, remote control
and acquisition modes 8.1.1 AT+TYPEà This command only can be used for HM-10/11. The HM-16/17 does not have the acquisition function.
9. How to realize battery capacity collecting
9.1.1 AT+BATCàTurn on the battery power switch 9.1.2 AT+RESET 9.1.3 AT+BATTàCollect the battery power This command only can be used for HM-10/11
10. How to output square wave
10.1 Only PIO2 can output square wave 10.1.1 AT+PIO2[0~9] This command only can be used for HM-10/11
11. How to collect ADC
11.1 HM-10 provided 8 PIOs which from PIO3 to PIOB 11.1.1 AT+ADC[PIO]? The reference voltage is power supply voltage. This command only can be used for HM-10/11
12. How to collect the temperature and humidity data
12.1.1 AT+TEMP? à If HMSensor has already set up the relevant sensor, the data can be output automagically. If not, the data will return to the value of chip sensor. 12.1.2 AT+TEHU? à When HMSensor was using the DHT11 sensor, please using this step, otherwise please do not. This command only can be used for HM-10/11
13. How to realize sending commands by using smartphone
13.1.1 AT+MODEà Set up the module working mode through UART