打印

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

[复制链接]
130|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

粉丝