Skip to content

SERIAL_8E1: wrong data #50

Closed
Closed
@Adminius

Description

@Adminius
//#define SERIAL SerialUSB //Zero
#define SERIAL Serial //STM32

void setup() {
  SERIAL.begin(115200);
  while(!SERIAL);
  Serial1.begin(19200,SERIAL_8E1);
  SERIAL.println("Setup ready");
}

void loop() {
  SERIAL.println("Send 0xFF");
  Serial1.write(0xFF);
  int temp = 0;
  delay(50);
  while(Serial1.available()>0){
      temp = Serial1.read();
      SERIAL.print("Data: ");
      SERIAL.println(temp,HEX);
  }
  delay(10000);
}

i tested this code on Arduino Zero and L476 and with a loop connection (RX shorted to TX)

Zero write 0xFF and read 0xFF
L476 write 0xFF and read 0x7F

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions