Incoherent behavior of Serial.begin()

Hello,

I'm working with an Arduino Uno R3 and UART. The thing is that I'm getting a weird behavior with the serial communication.

My code is the following:

void setup(void) {

  Serial.begin(115200, SERIAL_8N1);

  delay(1000);

  Serial.println("Hello");

}

void loop(void) {

  }

As you can see, I'm explicitly setting the configuration in the Serial.begin() function to use 8 bit of data per frame, no parity bit and 1 stop bit. However, when looking for the communication using an oscilloscope, I need to configure it with no stop bit in order to be able to successfully decode the data. How is this possible?.

Attached goes a screenshot taken from the Picoscope 2204A.

The problem is in the way you are using the scope, not in the Arduino. Ask the Picoscope people.

Hello jremington ,

thanks for the answer. Can you elaborate more on that?. Why do you think the problem is in the scope and not the Arduino?. Can you spot the stop bit in the screenshot of the signal I sent?. When the decoder on the scope is configured with 1 stop bit, then the bytes can't be decoded but they can in the other way around.

I'll appreciate it any better explanation of what could be wrong either with the scope or the Arduino.

Thanks in advance.

jremington:
The problem is in the way you are using the scope, not in the Arduino. Ask the Picoscope people.

The stop-bit is a pause.

The signal is idle high, the start-bit is low and the stop-bit is high. That means that the stop-bit is actually a gap or a pause between the bytes.

Your waveform shows a high level between the bytes, that is the stop-bit.
So yes, jremington is right, the problem is the Picoscope. I don't know why the Picoscope is acting weird, I have never used it.
Would PulseView/sigrok work on your scope ? Pico Technology PicoScope 2204A - sigrok. Perhaps you can try that.

Thank you for your clear question, using code-tags and a screenshot :smiley:

The problem is not with the Arduino, because the serial output waveform is defined by the hardware in the AVR processor that has worked correctly, the world over, for decades.

The question is why the Picoscope does not correctly interpret the 8N1 waveform, and that is for the Picoscope people to answer. It seems likely that you are not using the Picoscope correctly.

However, when looking for the communication using an oscilloscope, I need to configure it with no stop bit in order to be able to successfully decode the data

So forgetting about the fancy pants stuff decoding stuff that your particular scope might be able to do, is the raw waveform the scope sees produced by Serial.begin(115200, SERIAL_8N1) correct or not ?

Thank you all for the answers. I have forwarded this post to the Picoscope people for review, maybe they can say why the software is not getting the right thing. In the meantime, I'll try with PulseView/sigrok to compare results.