Flow control

nuhhgets_

New member
Joined
Sep 3, 2025
Messages
2
I'm working on a USB-to-UART with an ATSAMD21 chip, and I want it to play nice with hardware flow control. I'm figuring out how the microcontroller can "know" if the computer it's talking to has turned flow control on. I'd rather not use a jumper or switch for this. Am I right in thinking the computer doesn't actually "tell" the microcontroller when it changes flow control settings? If so, what's the best way for the microcontroller to figure it out and switch flow control on itself?
 
Good question and you're right. A computer does not send a signal to a microcontroller to let it know that hardware flow control is enabled. The microcontroller has to figure it out on its own. The best way to do this is to check the state of the Clear to Send, or CTS, pin. If the CTS pin stays high, it means the computer is not ready to receive data. This tells the microcontroller to wait before sending anything. Your code should check this pin and adjust what it is doing based on the signal. That way, you do not need to use a physical jumper or a switch.
 
Yeah, usually, the MCU just watches the CTS/RTS lines directly, if CTS is asserted, you can send but if not, hold off. There's no automatic flag from the host, so monitoring the lines in your firmware is the standard way
 
Some use the SetControlLineState() to spot RTS tweaks and turn on CTS watching in UART. It's a great way to get things in sync when you don't have switches or need to adjust with settings.
 
Back
Top