user37000: I am trying, unsuccessfully to communicate, using my Arduino Nano, with a custom device at a baud rate of 800 kbit/s.
The Arduino code look like this:
void setup() {
  // Put your setup code here, to run once:
  Serial.begin(800000);
}

void loop() {
  // Put your main code here, to run repeatedly:
  delay(5000);
  Serial.println(0x2be1);
}

When I am trying to debug it with PuTTY the result is:

And when I change the baud rate to 400 kbit/s the result is (as it should be):

Any idea?

user7508: The Arduino Nano cannot do 800 kb/s. As you can see in the source
code, the bit duration is rounded to the nearest multiple of
8 CPU cycles. In your case, it is rounded to
3 × 8 CPU cycles, which yields a baud rate of
666.666 kb/s. That is 16% too slow, an error too large for any
communication to be possible.
At 400 kb/s there is no rounding error, so everything works fine.
Edit: Note that if you build your own barebones
Arduino, then either a 12.8 MHz or a 19.2 MHz
crystal should allow you to get that exact baud rate. But then
millis(), delay() and co. would all be off.

37000: <p>I am trying, unsuccessfully to communicate, using my Arduino Nano, with a custom device at a baud rate of 800&nbsp;kbit/s.</p>

<p>The Arduino code look like this:</p>

<pre><code>void setup() {
  // Put your setup code here, to run once:
  Serial.begin(800000);
}

void loop() {
  // Put your main code here, to run repeatedly:
  delay(5000);
  Serial.println(0x2be1);
}
</code></pre>

<p>When I am trying to debug it with PuTTY the result is:</p>

<p><a href="https://i.stack.imgur.com/eSFhQ.png" rel="nofollow noreferrer" title="PuTTY output @ 800 kb/s"><img src="https://i.stack.imgur.com/eSFhQ.png" alt="PuTTY output @ 800 kb/s" title="PuTTY output @ 800 kb/s"></a></p>

<p>And when I change the baud rate to 400&nbsp;kbit/s the result is (as it should be):</p>

<p><a href="https://i.stack.imgur.com/7qmLd.png" rel="nofollow noreferrer" title="PuTTY output @ 400 kb/s"><img src="https://i.stack.imgur.com/7qmLd.png" alt="PuTTY output @ 400 kb/s" title="PuTTY output @ 400 kb/s"></a></p>

<p>Any idea?</p>
 7508: <p>The Arduino Nano cannot do 800&nbsp;kb/s. As you can see in <a href="https://github.com/arduino/Arduino/blob/1.8.5/hardware/arduino/avr/cores/arduino/HardwareSerial.cpp#L106" rel="noreferrer">the source
code</a>, the bit duration is rounded to the nearest multiple of
8&nbsp;CPU cycles. In your case, it is rounded to
3&nbsp;×&nbsp;8&nbsp;CPU cycles, which yields a baud rate of
666.666&nbsp;kb/s. That is 16% too slow, an error too large for any
communication to be possible.</p>

<p>At 400&nbsp;kb/s there is no rounding error, so everything works fine.</p>

<p><strong>Edit</strong>: Note that if you build your own <a href="https://www.arduino.cc/en/Main/Standalone" rel="noreferrer">barebones
Arduino</a>, then either a 12.8&nbsp;MHz or a 19.2&nbsp;MHz
crystal should allow you to get that exact baud rate. But then
<code>millis()</code>, <code>delay()</code> and co. would all be off.</p>
