USART_InitStructure.USART_BaudRate = 1200; //波特率1200
USART_InitStructure.USART_WordLength = USART_WordLength_8b; //字长8位
USART_InitStructure.USART_StopBits = USART_StopBits_1; //1位停止字节
USART_InitStructure.USART_Parity = USART_Parity_No; //无奇偶校验
USART_InitStructure.USART_HardwareFlowControl =USART_HardwareFlowControl_None;//无流控制
USART_InitStructure.USART_Mode = USART_Mode_Rx|USART_Mode_Tx;//打开Rx接收和Tx发送功能
USART_Init(USART2, &USART_InitStructure); //初始化
/*使用中断*/
USART_ITConfig(USART2, USART_IT_RXNE, ENABLE);
USART_Cmd(USART2, ENABLE); //启动串口
串口配置为接收模式了,发送器都没有开启
但是tim2_ch3还是不起作用.
我打算是将PA2作为PWM输出的,但是现在一直都没有输出
只有把串口时钟不使能才可以有输出,但是这样的话我的PA3就作不了接收脚了
|