stm32如何用usart3实现非标准速率(速率为31.25kbpd)的uart协议?

[复制链接]
307|0
 楼主| 喷水壶 发表于 2019-11-28 15:00 | 显示全部楼层 |阅读模式
我实现过115200是可以的,但是实现31.25k时,收到的数据是乱码?
各位大侠帮着看看,多谢了~~

void USART_Configuration(void)                                                      
{
    //USART1  
    USART_InitTypeDef USART_InitStructure;                                          
    USART_InitStructure.USART_BaudRate = 115200;//9600;                             
    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);
您需要登录后才可以回帖 登录 | 注册

本版积分规则

433

主题

437

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部