Just discovered the maximum serial speed on the mega 2560.

I was messing around and discovered that using speed exactly 4000000 works the fastest. 4000001 doesn't work in my testing. Heres how i found out:

void setup() {
  // put your setup code here, to run once:
  Serial.begin(4000000);
}

void loop() {
  // put your main code here, to run repeatedly:
  if (Serial.available() > 0) {
    char a = Serial.read();
    Serial.write(a);
  }
}

This code will check for anything received in serial, and echos it back. Its best to test this in PuTTY as you can type in any speed, instead of worrying about using only up to 250000. If you type in any character it should come back where your cursor was. Its like it was a notepad document. Feel free to change the speed in Serial.begin(speed_here); for your own testing.

The highest possible baud rate for an AVR processor running at 16 MHz is 2 M.

http://wormfood.net/avrbaudcalc.php?bitrate=1000000%2C2000000%2C4000000&clock=16&databits=8

Sure you aren't using a Due? :slight_smile: