2016-10-04 05:31 PM
Hello,
If a pin is configured as Push Pull, can we still specify a pull up resistor to go with it?(Is the pull up used to avoid floating conditions even in Push-Pull configurations?) /**USART2 GPIO Configuration PA2 ------> USART2_TX PA3 ------> USART2_RX */ GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; GPIO_InitStruct.Alternate = GPIO_AF7_USART2; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
2016-10-04 07:17 PM
ok, I think I understand it now.
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP is relevant only to the output [Tx] pin of the UART port. GPIO_InitStruct.Pull = GPIO_PULLUP applies only to the input [Rx] pin of the UART port. Feel free to comment if you see it differently.2016-10-05 03:40 AM
From what I understand, you can activate Pull (up|down) together with ush/pull output. However this does not make sense.