关于S32DS的LPUART2串口的波特率的配置

关于S32DS的LPUART2的波特率的配置 实测可用

12-0   SBR
Baud Rate Modulo Divisor.
The 13 bits in SBR[12:0] set the modulo divide rate for the baud rate generator. When SBR is 1 - 8191,
the baud rate equals "baud clock / ((OSR+1) × SBR)". The 13-bit baud rate setting [SBR12:SBR0] must
only be updated when the transmitter and receiver are both disabled (LPUART_CTRL[RE] and
LPUART_CTRL[TE] are both 0).
 
28-24
OSR
Oversampling Ratio
This field configures the oversampling ratio for the receiver. This field should only be changed when the
transmitter and receiver are both disabled.

 

由于电脑加密,不能截图,数据手册只用上两个位定义就够

公式为    baud= clock / ((OSR+1) × SBR)

也就是    baud=8M/((OSR+1)× SBR )

所以9600的波特率为  //LPUART2->BAUD = 0x0F000034;  //波特率 9600    baud=8M/((15+1)× 52 )

所以115200的波特率为  //LPUART2->BAUD = 0x0D000005;  //波特率 115200    baud=8M/((13+1)× 5)

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值