LPUART Baudrate issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPUART Baudrate issue

Jump to solution
3,069 Views
sandhyaravikuma
Contributor II

Hi,

 

I am working on S32K144 LPUART. I want to test UART with 115200 baud rate for BLE connectivity. When configure baudrate as 115200kbps actual baud rate is 115384kbps.

When communicating only to BLE, communication is successful, once few task are added communication fails.

How to configure to 115200 exactly?

Thanks & Regards,

0 Kudos
1 Solution
2,993 Views
sandhyaravikuma
Contributor II

Thanks Robin. I measured and changed the baud rate. It is now working consistently. My problem has been solved by changing the LPUART0 clock to SIRCDIV2_CLK and by changing the Baud rate. Appreciate your help in getting it to work.

Best regards

Sandhya

View solution in original post

0 Kudos
8 Replies
3,014 Views
sandhyaravikuma
Contributor II

Thank you. After changing the clock for LPUART0 to SIRCDIV2_CLK, the BLE app is now connecting, but not consistently every time. It is successful 3 out of 5 times. What could be the reason? I am using LPUART1 with FIRCDIV2_CLK for USART interface, which is working fine. WIll this be affecting the behaviour of the BLE?

0 Kudos
3,003 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Please check the real baudrate of BLE.(Measure the bit width of signal sent out from BLE by using oscilloscope.)
You can adjust the baud rate of LPUART as close as possible to the baud rate of BLE.
You don't have to configure the baud rate of LPUART to 115200, just need to make the UART baud rate meet the tolerance require of BLE.

Best Regards,
Robin

0 Kudos
2,994 Views
sandhyaravikuma
Contributor II

Thanks Robin. I measured and changed the baud rate. It is now working consistently. My problem has been solved by changing the LPUART0 clock to SIRCDIV2_CLK and by changing the Baud rate. Appreciate your help in getting it to work.

Best regards

Sandhya

0 Kudos
3,059 Views
sandhyaravikuma
Contributor II

Hi,

I am using FIRCDIV2_CLK for LPUART. Is that correct?

I have not measured the baud rate.

Thanks and Regards

0 Kudos
3,047 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi sandhyaravikuma,

Would you please let me know the frequency of your BUS_CLK?
According to the "Table 27-8. Peripheral clock summary": Maximum frequency governed by BUS_CLK.

Table 27-8. Peripheral clock summary.png

If the frequency of BUS_CLK is less than FIRC_DIV2(48MHz), then you can not use FIRC_DIV2 as the Peripheral functional clock of LPUART.

Best Regards,
Robin

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
3,033 Views
sandhyaravikuma
Contributor II

My BUS_CLK is 12MHz and FIRCDIV2_CLK is 24MHz. But changing the BUS_CLK to 24MHz gives a warning in Component Inspector. How can I make the change for BUS_CLK?

sandhyaravikuma_0-1599901713031.png

 

 

0 Kudos
3,023 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

If you cannot modify the BUS frequency, you can consider change a lower frequency Peripheral functional clock.

LPUARTx_CLK.png

0 Kudos
3,064 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi sandhyaravikuma,

Have you try to measure the baud rate when communication fails?
Would you please tell me clock source of LPUART? The accuracy of the clock source will also affect the baud rate.

clock source.png

Best Regards,
Robin

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos