On the S32K312 EVB, the actual baud rate does not match the configured baud rate

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

On the S32K312 EVB, the actual baud rate does not match the configured baud rate

Jump to solution
986 Views
Cooper24025
Contributor II

Hi, I am using UART on the S32K312 EVB to transmit data between the development board and a computer. When I set the baud rate of UART0 to 19200, the computer (in PuTTY) needs to be set to 38400 to receive the correct data. Could you please let me know if there is any misconfiguration? Thank you. Attached is the project I am using.

 

螢幕擷取畫面 2024-10-07 181019.png

Tags (3)
0 Kudos
Reply
1 Solution
898 Views
Cooper24025
Contributor II

hi @Julián_AragónM

Thank you for the reply. I found the solution to my problem. The clock sources for LPUART0 and LPUART6 are different, so I need to set two different clock references. However, I was using the same clock reference before, which is why there is a difference in baud rates between the two LPUARTs. Thank you again for your response.

View solution in original post

0 Kudos
Reply
4 Replies
963 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Cooper24025,

Could you check your connections as well as PuTTY configuration? I have downloaded your project and tested the transmission. It seems to be correct, only that in line 152, when using Uart_AsyncSend, channel 1 (lpuart0) is used instead of channel 0 (lpuart6), after editing that portion of the function, I can see the message on TeraTerm:

1.png

Julin_AragnM_0-1728327406610.png

Best regards,
Julián 

0 Kudos
Reply
939 Views
Cooper24025
Contributor II

hi. Thank you very much for your reply. I have checked the settings in PuTTY and tried different boards, but I'm still experiencing some issues. In this project, I have set up two channels: channel 0 uses LPUART6, and channel 1 uses LPUART0. Both channels are configured with a baud rate of 19200. However, when receiving data in PuTTY (baud rate 19200), I can receive data correctly from channel 0 (LPUART6), but I cannot receive the correct data from channel 1 (LPUART0); instead, I get garbled data. I have to set PuTTY's baud rate to 38400 to receive data correctly from channel 1 (LPUART0). Additionally, I have confirmed that the BAUD registers for both LPUART0 and LPUART6 are the same at runtime. I would like to ask if you have any other thoughts on this. Thank you.

 

Tags (3)
0 Kudos
Reply
917 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Cooper24025,

It seems that the generated code is wrong. I can see inside the Lpuart_Uart_Ip_BOARD_InitPeripherals_PBcfg file, the same clock divisor is used for the baud rate calculation for both UART instances, even though they do not share the same clock:

Julin_AragnM_0-1728424314852.png

Julin_AragnM_1-1728424442737.png

Could you share your RTD version (and patch as well)? I am unable to reproduce the issue in RTD 3.0.0 or newer releases. This may be an issue with MCAL drivers, as I've tested with the IP drivers, and this is not replicable:

Julin_AragnM_2-1728425817695.png

Best regards,
Julián

0 Kudos
Reply
899 Views
Cooper24025
Contributor II

hi @Julián_AragónM

Thank you for the reply. I found the solution to my problem. The clock sources for LPUART0 and LPUART6 are different, so I need to set two different clock references. However, I was using the same clock reference before, which is why there is a difference in baud rates between the two LPUARTs. Thank you again for your response.

0 Kudos
Reply