UART answer in 2ms

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: UART answer in 2ms

Post by Roberthh » Wed Sep 11, 2019 7:51 pm

Looking into the code a little bit further, the are two timeout parameters:
a) timeout=xxx Unit ms. Timeout to wait for a character to arrive. That is important for uart read calls.
b) timeout_char=xx Unit chars. Timeout for the ISR between characters. It seems that no character is signaled to be received until this timeout expired. The default set by the driver seems to be 8. The smallest reasonable value is 1. The Micropython API sets it to at least 2.
These parameters are documented for the pyb.uart() class, and implementing timeout_char for the ESP32 seems to be done only halfway. There parameter of the API is accepted, but no setting in the underlying RTOS layers. There might have been a good reason for that.

Wander
Posts: 6
Joined: Wed Sep 11, 2019 1:03 am
Location: Brazil

Re: UART answer in 2ms

Post by Wander » Thu Sep 12, 2019 12:41 am

Yes!!! It works!! :D
Thank you!
Attachments
UART_1ms.png
UART_1ms.png (24.83 KiB) Viewed 1444 times

Post Reply