Problem setting UART baud rate in MKL36Z256VLH4

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problem setting UART baud rate in MKL36Z256VLH4

ソリューションへジャンプ
1,088件の閲覧回数
aniketc
Contributor II

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

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
881件の閲覧回数
mjbcswitzerland
Specialist V

Hi Anitek

The UART in the KL36 doesn't have a fractional divider and so you need to supply a clock that is suitable for the baud rate that you require.

4MHz MCGIRCLK is limited due to its low frequency and not suitable for 115200 Baud.
You can however use MCGFLLCLK instead and achieve 115'318 (typical) if you use the internal 32kHz IRC and FLL set to 732 (24MHz).

Regards

Mark


Kinetis: http://www.utasker.com/kinetis.html
Kinetis KL43:
- http://www.utasker.com/kinetis/FRDM-KL43Z.html
- http://www.utasker.com/kinetis/TWR-KL43Z48M.html

SLCD: http://www.utasker.com/docs/uTasker/uTasker_SLCD.pdf


Free Open Source solution: https://github.com/uTasker/uTasker-Kinetis
Working project in 15 minutes video: https://youtu.be/K8ScSgpgQ6M

For better, faster, cheaper product developments consider the uTasker developer's version, professional Kinetis support, one-on-one training and complete fast-track project solutions to set you apart from the herd : http://www.utasker.com/support.html

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
882件の閲覧回数
mjbcswitzerland
Specialist V

Hi Anitek

The UART in the KL36 doesn't have a fractional divider and so you need to supply a clock that is suitable for the baud rate that you require.

4MHz MCGIRCLK is limited due to its low frequency and not suitable for 115200 Baud.
You can however use MCGFLLCLK instead and achieve 115'318 (typical) if you use the internal 32kHz IRC and FLL set to 732 (24MHz).

Regards

Mark


Kinetis: http://www.utasker.com/kinetis.html
Kinetis KL43:
- http://www.utasker.com/kinetis/FRDM-KL43Z.html
- http://www.utasker.com/kinetis/TWR-KL43Z48M.html

SLCD: http://www.utasker.com/docs/uTasker/uTasker_SLCD.pdf


Free Open Source solution: https://github.com/uTasker/uTasker-Kinetis
Working project in 15 minutes video: https://youtu.be/K8ScSgpgQ6M

For better, faster, cheaper product developments consider the uTasker developer's version, professional Kinetis support, one-on-one training and complete fast-track project solutions to set you apart from the herd : http://www.utasker.com/support.html

0 件の賞賛
返信