STM32使用USART初始化设置停止位为1,示波器实际测量是2位,是什么原因呢?请高手帮忙看看
初始化部分代码:
USART_InitStructure.USART_BaudRate = bound;
USART_InitStructure.USART_WordLength = USART_WordLength_8b;
USART_InitStructure.USART_StopBits = USART_StopBits_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;
USART_Init(USART1, &USART_InitStructure);
USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);
USART_Cmd(USART1, ENABLE);
串口发送数据部分代码:
for(i=0;i<DataLen;i++)
{
USART_SendData(USART1, DMX_buf[i]);
while(USART_GetFlagStatus(USART1,USART_FLAG_TC)!=SET);
}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>