UART Flow Control
-
- Posts: 30
- Joined: Mon Sep 17, 2018 6:39 am
UART Flow Control
Hello All,
I have been using UART1 without hardware or software flow control. What are the benefits to using software flow control and if I decide to do so, when should I be calling uart_set_rts() and uart_set_dts()?
I have been using UART1 without hardware or software flow control. What are the benefits to using software flow control and if I decide to do so, when should I be calling uart_set_rts() and uart_set_dts()?
-
- Posts: 9723
- Joined: Thu Nov 26, 2015 4:08 am
Re: UART Flow Control
Are you sure you need flow control in the first place? It's usually only needed when a device is not fast enough to parse the incoming data as it comes in.
-
- Posts: 30
- Joined: Mon Sep 17, 2018 6:39 am
Re: UART Flow Control
I have done some research and realize that I do not need it.
- gunar.kroeger
- Posts: 143
- Joined: Fri Jul 27, 2018 6:48 pm
Re: UART Flow Control
Please when answering questions remember that other people try to find solutions here.
It is so annoying finding the questions in the forum but no real answer.
I don't understand what the sw flow control does based on documentation. I also tried searching for examples of uart with DMA and always find only evasive answers like "surely you don't need it"
I'm trying to get the maximum out of the uart link between two esp32 in our project, but I'm getting FIFO OVERFLOW. We only have tx and rx lines connected.
It is so annoying finding the questions in the forum but no real answer.
I don't understand what the sw flow control does based on documentation. I also tried searching for examples of uart with DMA and always find only evasive answers like "surely you don't need it"
I'm trying to get the maximum out of the uart link between two esp32 in our project, but I'm getting FIFO OVERFLOW. We only have tx and rx lines connected.
"Running was invented in 1612 by Thomas Running when he tried to walk twice at the same time."
-
- Posts: 9723
- Joined: Thu Nov 26, 2015 4:08 am
Re: UART Flow Control
You could also, y'know, ask your own question related to this instead of hoping to glance information from the failures of others?
- gunar.kroeger
- Posts: 143
- Joined: Fri Jul 27, 2018 6:48 pm
Re: UART Flow Control
I don't mean to be toxic.
Unfortunately I have several unanswered topics in this forum already, and I know that this is because you are answering them when you can and that this is not your full time job
So I'm only suggesting that if you could please from now on consider giving more complete answeres to questions, point to the right documentation, and if the documentation about this topic is unclear, improve the documentation.
That would surely be a better use of your and our time.
Thanks
Unfortunately I have several unanswered topics in this forum already, and I know that this is because you are answering them when you can and that this is not your full time job
So I'm only suggesting that if you could please from now on consider giving more complete answeres to questions, point to the right documentation, and if the documentation about this topic is unclear, improve the documentation.
That would surely be a better use of your and our time.
Thanks
"Running was invented in 1612 by Thomas Running when he tried to walk twice at the same time."
-
- Posts: 9723
- Joined: Thu Nov 26, 2015 4:08 am
Re: UART Flow Control
Support like this is entirely on a as-needed basis, imo. I can write an entire book about hardware handshaking and then find out the other guy only needs a little bit of it (or none at all as they might have an X/Y problem), but I'd rather just help people solve the problem at hand. If you need to know something, just ask. That also helps me pinpoint exactly what is missing in the documentation instead of a general 'something something hardware handshaking' idea.
-
- Posts: 26
- Joined: Tue Mar 31, 2020 7:26 pm
Re: UART Flow Control
First of all, flow control is only used if you want to control the data being passed between the two devices, the flow control pins are CTR and RTS, along with the TX and RX pins, now you have 4 pins for the UART protocol. One for the host, and the other for the device (or the slave should I say). They are used for many reasons, could be for example the device has no free memory, so it uses the flow control pins to tell the other device to hold its data and wait. But, most of the sensors or other electronic parts does support these flow control pins. However, if the buffer becomes full, all the data that you are receiving after the buffer became full will be lost, which is bad. If you are using ESP-IDF to program it, you could set a threshold (meaning if you receive a specific amount of bytes, it will use the flow control pins to tell the other device to stop sending data), this is very useful if you are using the UART protocol to transfer a huge amount of data. This is the function link inside hte ESP-IDF documentation, if you are the Arduino IDE, you could still use that function, just tell me and I will help you to use it: https://docs.espressif.com/projects/esp ... _t7uint8_t. Best regards, Hasan Shadi.jollytopper wrote: ↑Thu May 30, 2019 2:43 amHello All,
I have been using UART1 without hardware or software flow control. What are the benefits to using software flow control and if I decide to do so, when should I be calling uart_set_rts() and uart_set_dts()?
Re: UART Flow Control
Hello Hasan, I've tried usingHasan Shadi wrote: ↑Fri May 29, 2020 4:19 amFirst of all, flow control is only used if you want to control the data being passed between the two devices, the flow control pins are CTR and RTS, along with the TX and RX pins, now you have 4 pins for the UART protocol. One for the host, and the other for the device (or the slave should I say). They are used for many reasons, could be for example the device has no free memory, so it uses the flow control pins to tell the other device to hold its data and wait. But, most of the sensors or other electronic parts does support these flow control pins. However, if the buffer becomes full, all the data that you are receiving after the buffer became full will be lost, which is bad. If you are using ESP-IDF to program it, you could set a threshold (meaning if you receive a specific amount of bytes, it will use the flow control pins to tell the other device to stop sending data), this is very useful if you are using the UART protocol to transfer a huge amount of data. This is the function link inside hte ESP-IDF documentation, if you are the Arduino IDE, you could still use that function, just tell me and I will help you to use it: https://docs.espressif.com/projects/esp ... _t7uint8_t. Best regards, Hasan Shadi.jollytopper wrote: ↑Thu May 30, 2019 2:43 amHello All,
I have been using UART1 without hardware or software flow control. What are the benefits to using software flow control and if I decide to do so, when should I be calling uart_set_rts() and uart_set_dts()?
Code: Select all
uart_set_hw_flow_ctrl()
Code: Select all
Serial.begin()
Code: Select all
Serial.begin()
Thanks in advance for your help!
Who is online
Users browsing this forum: Majestic-12 [Bot] and 37 guests