Hello,
I'm trying to use uart_echo example as the base for my code. I want to read 4 bytes (with 4800 baud rate), then transmit them back, but the problem is I get about 20ms delay between Rx & Tx.
The code is so simple, but I can't understand what is the problem. Can anyone help me? I'm so confused.
P.S.: I tryed the uart_event example also, but the problem remains the same.
UART echo delay problem
-
- Posts: 9043
- Joined: Thu Nov 26, 2015 4:08 am
Re: UART echo delay problem
Your issue is likely that the uart hardware tries to minimize interrupts, that is, it will wait until there is no more data incoming for a while before software actually receives the data. You could set that timeout to 0 using uart_set_rx_timeout() and see if that solves the issue.
-
- Posts: 3
- Joined: Sat Apr 09, 2022 10:35 am
Re: UART echo delay problem
ESP_Sprite wrote: ↑Tue May 24, 2022 1:57 amYour issue is likely that the uart hardware tries to minimize interrupts, that is, it will wait until there is no more data incoming for a while before software actually receives the data. You could set that timeout to 0 using uart_set_rx_timeout() and see if that solves the issue.
Thank you for your support. I've tested your suggestion, but it didn't work. Plus, I'm not sure how that would work.