HC-06: Higher than 230400 bps Possible?

Hello everyone,

I have been playing around with this HC-06 for hours trying to figure out what maximum speed I can achieve with it. Essentially, what I want to do is try to run it at 921600 bps for a camera module I'm using.

I downloaded RealTerm in order to send commands to the HC-06 (over USB through a USB-Serial converter) at any baud rate (I chose RealTerm over PuTTy because I could send strings instead of single characters).

Upon connecting and sending "AT", I get an "OK" back if I'm communicating at the same baud rate as the HC-06. I can change the baud rate using:

AT+BAUD1: 1200 bps
AT+BAUD2: 2400 bps
AT+BAUD3: 4800 bps
AT+BAUD4: 9600 bps
AT+BAUD5: 19200 bps
AT+BAUD6: 38400 bps
AT+BAUD7: 57600 bps
AT+BAUD8: 115200 bps
AT+BAUD9: 230400 bps
AT+BAUDA: 460800 bps
AT+BAUDB: 921600 bps
AT+BAUDC: 1382400 bps

When I change the baud rate with this method, I can simply disconnect and reconnect at the selected baud rate and continue communication, no problems, all the way up to the maximum 1382400 bps. This reassured me that the HC-06 could reliably communicate at the highest baud rate of 1382400 bps, even if only in AT mode so far (flashing red LED).

So to test this, I changed the baud rate to something, then programmed an Arduino with very simple code:

void setup()
{
  Serial.begin(<baud_rate>);
  delay(1000);
  Serial.print("AT+BAUD4");
}

void loop()
{
  
}

This code would simply attempt to change the baud rate of the HC-06 to 9600 bps on startup or reset. <baud_rate> is simply the baud rate that I had set the HC-06 to using RealTerm.

Here's where my problem is:
This method successfully changes the baud rate of the HC-06 only if <baud_rate> is 230400 bps or less. Once I use AT+BAUDA or higher, the Arduino method fails. I made sure to disconnect any RX or TX lines going to anything except the HC-06 when testing, and I'm powering the Arduino with a battery to avoid any USB interference or whatever. I'm sure all necessary wiring is correct, as this consistently works all the way up to AT+BAUD9, but anything more will fail. If I reconnect to the HC-06 module using RealTerm and my USB-Serial converter, I can communicate fine.

I tried this with both an Arduino Nano (ATMega328p) and an Arduino Mega 2560. For the Arduino Mega, I tried hardware serial channels Serial and Serial3. No luck. Naturally, I suspected that the Arduinos could not communicate at this higher baud rate, so I set up another test:
I used one of the Arduinos to send an "X" to the other. I made the other one look for an "X" and flash the LED on pin 13 several times quickly to signify success. Both Arduinos were fine up to 4000000 bps (much higher than I expected; I didn't test higher). I once again tested Serial and Serial3 on the Mega. Both were fine. I even tried sending entire strings from Arduino to Arduino at 4000000 bps, and I could receive everything fine.

I'm very stumped at this point. I would be fine if it just didn't work. But I know it does work with RealTerm through my USB-Serial converter. How is this serial different from Arduino's?

Regards.

The Atmega328 datasheet has a table showing the performance at different baud rates. For 16MHz it lists 230400 (with 8.5% or -3.5% error) and 250k, 500k and 1M with 0% error.

It may be that it cannot work with sufficient timing accuracy at the higher baud rates that you list. All the details are in the datasheet including a formula for doing the necessary calculations.

...R

tincanman8:
This reassured me that the HC-06 could reliably communicate at the highest baud rate of 1382400 bps, even if only in AT mode so far (flashing red LED).

The default rate for HC-06 in AT mode is 9600. I don't think that can be changed.

Robin2:
The Atmega328 datasheet has a table showing the performance at different baud rates. For 16MHz it lists 230400 (with 8.5% or -3.5% error) and 250k, 500k and 1M with 0% error.

It may be that it cannot work with sufficient timing accuracy at the higher baud rates that you list. All the details are in the datasheet including a formula for doing the necessary calculations.

...R

That makes sense. But what about my communication between Arduinos still being fine? Do you think the Arduinos simply have better error checking/correction or whatnot? I thought doing that test would rule out any problems with the Arduino running at that baud rate (921600 bps).

tincanman8:
That makes sense. But what about my communication between Arduinos still being fine? Do you think the Arduinos simply have better error checking/correction or whatnot? I thought doing that test would rule out any problems with the Arduino running at that baud rate (921600 bps).

Without seeing a pair of program that demonstrates the problem I don't know where the problem may lie.

...R