Hello, i am using esp32 hardware serial to comunicate with car ecu via kline adapter, problem is i need specific baudrate of 10400. Its not working using
"Serial1.begin(10400, SERIAL_8N1, 22, 23)"
But if i use Esp softwareserial library its working, with the same pins
softSerial.begin(10400, EspSoftwareSerial::SWSERIAL_8N1, 22, 23)"
i found 5 year old issue wit this in github HardwareSerial incorrect timing with non standard baudrate · Issue #2004 · espressif/arduino-esp32 · GitHub
Can someone help me what i need to configure to work with this baudrate?
i am limited to 10400 because its coded in ecu side. Softwareserial somehow always at receiving data from ecu returns at beginning last byte of my request data. like this. even after Serial.flush() after tx.
TX to ECU: 81 12 F3 81 7
RX from ECU : 7 83 F3 12 C1 EF 8F C7
without Serial.flush() usage i am getting
TX to ECU: 81 12 F3 81 7
RX from ECU : 81 12 F3 81 7 83 F3 12 C1 EF 8F C7
ok figured it out. I made few mistakes. I declared UART pins as input and output after "Serial1.begin(10400, SERIAL_8N1, 22, 23)", i need this because there is specific startup sequence before comunication with ecu for tx pin HIGH 25ms and LOW 25ms. So correct way for esp32 is declare pins and do startup sequence request before calling Serial1.begin. So everything works ok with 10400 baudrate.