关于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)