AnsweredAssumed Answered

Problem setting UART baud rate in MKL36Z256VLH4

Question asked by aniket c on Mar 17, 2018
Latest reply on Mar 19, 2018 by Butcher

Hi,

 

We are using MKL36Z256VLH4 in one of our product. We need to use the UART functionality on pin PTE22 and PTE23 i.e.UART2_TX and UART2_RX with baud rate 115200.


While selecting value for SBR12:SBR0 in UARTx_BDH and UARTx_BDL, we used formula BaudRate = UART Module Clock/(SBR 12:0 X 16). As Bus clock is used as UART Module Clock, we have selected 4MHz Internal reference clock as Bus clock.

So while selecting SBR12:SBR0 with bus clock 4Mhz and required UART baud rate 115200, the value comes out to be 2.170 . So, rounding of the value SBR12:SBR0 to 2, the UART baudrate generated is 125000. We can observe data at 125000 bps, but not at 115200.

 

What can be done to achive baud rate of 115200? Am I missing something? We have used a microcontroller in other product, from K30-series which had BRFA register for fine adjustment of Baudrate, do we need to do any such settings for MKL36Z256VLH4 ?

 

Thanks in Advance.

 

Regards,
Aniket

Outcomes