HM-11 Bluetooth module, no USART response after baud rate change

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When switched on the module responds to the AT, AT+BAUD? commands, the baud rate is 9600, 8N1

If I try to change the baud rate to 38400 with the AT+BAUD2 command and change the RX rate to 38400 after the last command character has been sent there is no response, which should be OK+Set:2

Has anyone tried this?

It's not clear from the datasheet when the module TX baud rate is changed

Jerry

PS The datasheet (http://www.huamaosoft.com/blueto...) must be the worst I've ever read. Bad spelling and grammar, default values not always given, behaviour sometimes unclear

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does it remember the setting for the next power off, power on cycle?

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

huamaosoft.com wrote:

☆ Type: HM-11S
 ☆ Size: 13 * 18 * 2.2 mm
 ☆ BT Version: V4.0 BLE bluetooth
 ☆ Hardware: CC254x; On board 32MHz; On board 32.768KHz
 ☆ Firmware: V605

 

http://www.huamaosoft.com/blueto...

So I wonder if they're using custom firmware, or just some standard release from TI?

 

Might be worth checking on the TI site for any clues ...

 

jerryr wrote:
must be the worst I've ever read. 

So what is the compelling reason to use this particular module?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jerryr wrote:
If I try to change the baud rate to 38400 with the AT+BAUD2 command and change the RX rate to 38400 after the last command character has been sent there is no response, which should be OK+Set:2

Have you tested (or are you testing) this using a terminal app on a PC ?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:
Does it remember the setting for the next power off, power on cycle?

Thanks for the hint. I'll try it out

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
Have you tested (or are you testing) this using a terminal app on a PC ?

Thanks for the answer. I'm talking to the module with a program on a SAMD21J (Sparkfun SAMD21 breakout board

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You should always try this kind of thing with a terminal first - otherwise you don't know if the problem lies in the BLE module, your code - or both!

 

 

EDIT

 

More on debugging serial comms:

 

https://www.avrfreaks.net/commen...

 

https://www.avrfreaks.net/commen...

 

https://www.avrfreaks.net/commen...

 

https://www.avrfreaks.net/commen...

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Fri. Mar 23, 2018 - 08:51 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
You should always try this kind of thing with a terminal first - otherwise you don't know if the problem lies in the BLE module, your code - or both!

Hello awneil,

    But MY code NEVER has bugs, only special features

At least I could see that the right string was being transmitted

In spite of the bug free code I'll try it with a terminal

Jerry

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

laugh

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

May I reccomend (yet again) an USD 5 Logic Analyser from Ali / Ebay / China? (Search for "24m 8ch").

With a LA (& https://sigrok.org/  software) you can very easily determine if your Bluetooth module spits out any data after a reset or power cycle.

If you have cought some data, the LA can add a "uart decoder" and it can easily tell you what data your module has send and at what baudrate.

With this feature I for example very quickly found that an ESP8266 module I used once spits out UART data at 2 different baud rates after a reset.

That is hard to catch with a normal terminal emulator.

 

If you use a terminal emulator, then look carefully for any unintelligable characters.

Those usually indicate that your module is sending some data, but you are decoding it at the wrong baudrate.

With a terminal emulator the guesswork starts, with a LA or oscilloscope (much more expensive) you can see rapidly what the actual baudrate is.

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com