cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 Hardware Flow Control

Posted on August 20, 2014 at 04:39

I am communicating with an STM32F407 from a computer via Serial. I would like to implement flow control, but I have some questions.

1) Can I manually control the RTS line, so that I can receive a command from the PC and process it, then be ready to receive data, rather than get swamped by data

2) How would I set/reset this pin?

Cheers

#discovery #flowcontrol #stm32f4
2 REPLIES 2
Posted on August 20, 2014 at 05:11

Configure it as a GPIO pin (instead of Alternate Function), and drive it high/low as you would any other GPIO pin.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on August 20, 2014 at 05:26

/* GPIOG Peripheral clock enable */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOG, ENABLE);
/* Configure PG6 in output pushpull mode */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz; // Something appropriate
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOG, &GPIO_InitStructure);
GPIO_ResetBits(GPIOG, GPIO_Pin_6); // PG6 Low
GPIO_SetBits(GPIOG, GPIO_Pin_6); // PG6 High

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