I am having problems getting hardware control (CTS/RTS) to work on the STM32L chip.
Below is how I setup the GPIO lines: void CommPort_SetupCtsRtsLine ( void ) { GPIO_InitTypeDef GPIO_InitStructure;
// Enable GPIO Periph bus clock. RCC_AHBPeriphClockCmd ( RCC_AHBPeriph_GPIOA, ENABLE );
/* Configure USART2 RTS and USART2 Tx as alternate function push-pull */ GPIO_InitStructure.GPIO_Pin = COMM_PORT_RTS_PIN_NAME | USART2_TXD_PIN_NAME; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_Init(USART2_PORT_NAME, &GPIO_InitStructure);
/* Configure USART2 CTS and USART2 Rx as input floating */ GPIO_InitStructure.GPIO_Pin = COMM_PORT_CTS_PIN_NAME | USART2_RXD_PIN_NAME; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; GPIO_Init(USART2_PORT_NAME, &GPIO_InitStructure); }
When I connect to the board using Hyperterminal I don't see any handshaking going on.
I hope that someone can help me with this problem.
I wasn't dismissing them at all!
I use them myself, and have frequently recommended them both here and elsewhere.
eg, www.8052.com/.../165783 "Nobody should be without one of those!"
The most common basic problems are things like the lines not being connected correctly, not connected at all, or "stuck" in the wrong state - and LEDs are certainly great for spotting those kinds of issues.
Although RS232 handshake lines do tend not to be particularly high speed signals, I find they are still generally too fast to be effectively monitored with LEDs and the naked eye. That is where the scope comes in.
But, yes - LEDs first!