STM32 串口通信使用奇偶校验
- STM32串口通信如果使用奇偶校验,需要设置数据位长度为9bit
USART_InitStructure.USART_BaudRate = 9600;
USART_InitStructure.USART_WordLength = USART_WordLength_9b;
USART_InitStructure.USART_StopBits = USART_StopBits_1;
USART_InitStructure.USART_Parity = USART_Parity_Odd;
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
USART_Init( USART3, &USART_InitStructure);
作者: mr-xbt
本文来自博客园: https://www.cnblogs.com/xbotao/p/7291073.html
如有问题,请留言或者Email我: upc_xbt 163.com