I'm trying to communicate at a baud rate of 460800kbps. This works fine on Serial0, but not on Serials 1 - 3. It seems that 1 - 3 are only configured to run at 115200kbps. Is this correct? If so, is there any way of configuring 1 - 3 to run at 460800kbps? If not, just out of interest, why is that?
Bracey:
I'm trying to communicate at a baud rate of 460800kbps. This works fine on Serial0, but not on Serials 1 - 3. It seems that 1 - 3 are only configured to run at 115200kbps. Is this correct? If so, is there any way of configuring 1 - 3 to run at 460800kbps? If not, just out of interest, why is that?
Not sure. Some sources say you can do speeds of 2000000 bit per second.
Don't write 115200 kbps. It should be 115200 bps.
Apparently, the 'serial monitor' only allows up to 115200 bps. But they reckon that speeds of up to 1000000 bps are possible. So this may be good news for you.
Hi,
IDE 1.8.1 monitor 250000 bps. Win 7.
Tom..
You need to study the Atmega 2560 datasheet to figure out if it can reliably generate your desired baud rate. There is a formula. With a 16MHz clock it can produce 500,000 and 1,000,000 baud without any timing errors. But, for example, 115200 has a 2% to 3% error.
...R
I'm using RealTerm to send and receive data as the Arduino serial monitor only supports up to 250000kbps. The Mega will run at 460800 on the USB port (Serial 0) but not on Serials 1 - 3. I have connected a USB to FTDI cable to Serial 1 but do not get intelligible data.
Bracey:
I have connected a USB to FTDI cable to Serial 1 but do not get intelligible data.
Maybe the problem is with the USB-serial conversion by the cable. AFAIK the USB-TTL cable that I have works at 500,000 baud.
I have just tried the following program on my Mega and it works perfectly - I can see the output from both Serial ports in two different Minicom windows on my PC.
void setup() {
Serial.begin(500000);
Serial3.begin(500000);
}
void loop() {
Serial.println("Message for Serial0");
Serial3.println("Message for Serial3");
delay(1000);
}
...R
Thanks for the assistance Robin. Mine works at 500000 too, so it must be that there is too large an error at 460800. I'm trying interface to a piece of equipment that has that baud rate.
There is certainly a large error at 230400 - that is listed in the Datasheet. And you are trying to use twice that baud rate so it may double the error again.
...R
Every UART is very tolerant WRT baudrate, because it samples the signal at 16 times the baudrate. A difference of 8 ticks is acceptable during input of the 8 bits of a byte, meaning a 10% deviation from the exact baudrate..
At about 500kBaud I suspect that the transmission line is the most critical item. You better use RS-485 differential line drivers and twisted pair cables for such fast communication lines.
DrDiettrich:
At about 500kBaud I suspect that the transmission line is the most critical item.
If it works perfectly at 500,000 baud and not at 460,800 that is not where the problem lies.
...R
You are right in so far, as if Serial3 can be set to 500,000 baud, as you demonstrated, and that baud rate works fine on Serial, the problem must reside somewhere else.
The transmission line issue includes e.g. the Gnd line, which is often not connected by newbies.