Skip to main content
gbigden
Associate III
January 22, 2015
Question

Code example for USART cts/rts on STM32F3Discovery?

  • January 22, 2015
  • 3 replies
  • 707 views
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
This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
January 22, 2015
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
gbigden
gbigdenAuthor
Associate III
January 23, 2015
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?

Tesla DeLorean
Guru
January 23, 2015
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 (See Profile) Up vote any posts that you find helpful, it shows what's working..