Skip to content

HardwareSerial incorrect timing with non standard baudrate #2004

Closed
@aster94

Description

@aster94

Hardware:

Board: ESP32 Lolin 32 mini
Core Installation/update date: last from package manager (1.0.0?)
IDE name: vscode
Flash Frequency: tried both 40 and 80MHz
Upload Speed: 460800
Computer OS: xubuntu 18.04

Description:

Using a baudrate different form the standard (10400) brings to incorrect timing of the serial communication
I made a few samples with a salea logic analizer (clone) with the above settings:
config

Correct behaviour from an arduino mega:
mega 10400 o
mega 10400 o.txt

while esp plays a few jokes
esp 10400 o
esp 10400 o.txt

same at 80mhz
esp 80 10400 o
esp 80 10400 o.txt

same happens if i remove the odd parity bit
esp 10400 n
esp 10400 n.txt

while at a standard baud rate (115200) all is ok
esp 115200 n
esp 115200 n.txt

Sketch:

for esp

HardwareSerial ser(2);

void setup()
{
    ser.begin(10400,SERIAL_8O1);
}

void loop()
{
    for (uint8_t n = 1; n < 10; n++)
    {
        ser.write(n);
        delay(10);
    }
    delay(100);
}

for arduino mega

void setup()
{
    Serial2.begin(10400,SERIAL_8O1);
}

void loop()
{
    for (uint8_t n = 1; n < 10; n++)
    {
        Serial2.write(n);
        delay(10);
    }
    delay(100);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions