Home > other >  Normal STM32F103RBT6 serial normal receiving, sending, TXD pin no signal problem
Normal STM32F103RBT6 serial normal receiving, sending, TXD pin no signal problem

Time:12-01

STM32F103RBT6 serial port 1 normal receiving and sending process is also very normal, but no waveform, TXD pin this program or work, a few days ago a mystery, then to development board serial communication routines found the lack of a GPIO is initialized, GPIO_InitStructure. GPIO_Speed=GPIO_Speed_50MHz; , plus normal,

RCC_APB2PeriphClockCmd (RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOC, ENABLE);//can make GPIOA, D the clock
RCC_APB2PeriphClockCmd (RS485_USART_CLK, ENABLE);//can make USART1 clock
GPIO_InitStructure. GPIO_Pin=RS485_TX_GPIO_PIN;//PA9
GPIO_InitStructure. GPIO_Mode=GPIO_Mode_AF_PP;//reuse push-pull
GPIO_InitStructure. GPIO_Speed=GPIO_Speed_50MHz;
GPIO_Init (RS485_TX_GPIO_PORT, & amp; GPIO_InitStructure);

GPIO_InitStructure. GPIO_Pin=RS485_RX_GPIO_PIN;//PA10
GPIO_InitStructure. GPIO_Mode=GPIO_Mode_IPU;//floated input
GPIO_Init (RS485_RX_GPIO_PORT, & amp; GPIO_InitStructure);

CodePudding user response:

Write this blog ok, put here to do?