Replies: 1 comment
-
Switching to a different UART solved the problem. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I connect a garage motor to an ESP32 via RS485 or via a transreceiver which then converts it to a serial output (SP3485).
The baud rate is 19200 and the garage motor has some kind of synchronisation pulse before the data starts. This is also correctly displayed in the logic analyser. It is displayed as a UART framing error.
I used an ESP32-S2 for my first prototype. Here the error was detected correctly and the RX buffer only contained the data (0x00, 0xF2, 0x01, 0x02 and 0x98 in the picture) which was also completely correct and in line with expectations.
When I then used the same code with an ESP32-C3, unexpected problems occurred. It looks like the errors are not recognised and inserted into the RX buffer. As a result, everything shifts and wrong data comes out in the end. I tried this again with an ESP32-PICO-D4 devkit module but the result was identical. Except for the ESP32-S2 module, none of them worked reliably. Code was identical. And I can swap it around and sometimes it works (S2) and sometimes it doesn't (C3, D4).
Then I tried to interrupt the sync pulse on the C3 (ISR on falling, measure time, ISR on rising, measure time and if >800us then initialise UART). This also works great. However, it would be better not to have to jump back and forth between the functions (pin interrupt and UART).
Is there perhaps another trick I could try?
Beta Was this translation helpful? Give feedback.
All reactions