cancel
Showing results for 
Search instead for 
Did you mean: 

Code example for USART cts/rts on STM32F3Discovery?

gbigden
Associate III
Posted on January 22, 2015 at 15:27

Does anyone have a code example for the setup of the STM32F3 Discovery board USART using CTS/RTS handshaking please?

#stm32 #discovery #usart
3 REPLIES 3
Posted on January 22, 2015 at 18:39

Setting the pins up is relatively trivial, but you don't mention specific pins or a USART.

CTS/RTS is more about a buffering strategy.

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/stm32f2xx%20USART%20RTSCTS&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=1708

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
gbigden
Associate III
Posted on January 23, 2015 at 11:59

Thanks. The way I am doing things at present is to do most of my program under a timer interrupt and the rest, which is mainly RS232 processing, in a loop in main.c

I was assuming that cts/rts/ would be sufficient to stop the Rx buffer overflowing when connected to the other end (a PC). Is this not the case?

Posted on January 23, 2015 at 19:30

If the USART is not interrupting, then things are less complicated. If you leave data in the USART->DR (RX) it will signal the transmitter not to send any more. Similarly the TX side can be held off by the receiver. You can check the TXE flags and the CTS pin.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..