STM32
直播中

cherr番茄

12年用户 905经验值
私信 关注
[问答]

STM32串口通信如何使用奇偶校验?

STM32串口通信如何使用奇偶校验?

回帖(1)

赵敏

2021-12-10 09:36:30

  • 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);
举报

更多回帖

发帖
×
20
完善资料,
赚取积分