Serial Port fails with speeds greater than 19200 In Arduino Mega 2560 R3, properly selecting the Serial Monitor bauds, this code works with #define R 38400, but for some reason, not with #define R 19200 (?), 


#define R 38400
int rate=R;
HardwareSerial* hwSerial[]={&amp;Serial,&amp;Serial1,&amp;Serial2,&amp;Serial3};
void setup() {
    for (int i=0;i&lt;=3;i++){
        hwSerial[i]-&gt;begin(rate);
        while (!hwSerial[i]);
    } 
    hwSerial[0]-&gt;print("Hello World"); 
}

void loop() {
}


Both speeds should be not problematic for Arduino, what is happening?

It seems the int rate R; is problematic when changing speeds (??).
Answer is simple. You assign 38400 to a variable of type int. The signed range of integer values that can be stored in 16 bits is −32,768 through 32,767;