Using timeout on UART receiver

erikclaij
Posts: 4
Joined: Fri Oct 27, 2017 6:31 pm

Using timeout on UART receiver

Postby erikclaij » Fri Oct 27, 2017 6:44 pm

Hi,

I am using the ESP32 uart for a RS485 half duplex connection. I need a way to stop waiting for data on RX.

The loop I do:
- Send a RS485 command (500 kBaud)
- Wait for data or timeout in +/-25 us

It is completly IRQ based.

One way to do this is maybe a hardware timer with a irq.
Maybe it is also possible to use the UART_RXFIFO_TOUT_INT interrupt? But this part is not well documented.

Any ideas?

Best, Erik

chartle2
Posts: 4
Joined: Fri Oct 06, 2017 2:38 am

Re: Using timeout on UART receiver

Postby chartle2 » Mon Oct 30, 2017 7:21 pm

I haven't worked with UART yet, but it looks like the UART driver function uart_read_bytes( ... ) takes an arguement for timeout.

https://github.com/espressif/esp-idf/bl ... ver/uart.h

Who is online

Users browsing this forum: Majestic-12 [Bot] and 87 guests