S32K144 UART interrupt not reading data when baudrate is 115200

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

S32K144 UART interrupt not reading data when baudrate is 115200

1,605 Views
Vinod_Chinthoti
Contributor II

HI all,

i am using S32k144 controller, in this i enabled uart using "uartPal1" library.

i am using interrupt's to send & receive data from UART port. with 9600 & 57600 baudrate i am able to receive the data properly, but with 115200 baudrate data receiving not properly out of 10 time i am getting 2 times correct data and other times observed some junk data received. 

i am attaching my config details, please anyone look into this

/* Serial User Configurations */
uart_user_config_t uartPal1_Config0_RS485 = {
.baudRate = 115200,
.bitCount = UART_8_BITS_PER_CHAR,
.parityMode = UART_PARITY_DISABLED,
.stopBitCount = UART_ONE_STOP_BIT,
.transferType = UART_USING_INTERRUPTS,
.rxDMAChannel = 0U,
.txDMAChannel = 0U,
.rxCallback = UartPal1_Rx_Callback,
.rxCallbackParam = NULL,
.txCallback = UartPal1_Tx_Callback,
.txCallbackParam = NULL,
.extension = NULL
};

/* UART initialization for receive interrupt */

Usart_Receive_Data_Interrupt(&uartPal1_instance,&RS_DataToRead,RS485_Bytes_To_Read);
UART_SetRxBuffer(&uartPal1_instance, &RS_DataToRead,RS485_Bytes_To_Read);

 

0 Kudos
4 Replies

1,599 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Vinod_Chinthoti,

Please try to use S32K144 to send 0xAA or 0x55 to measure the bit width. It will show you the real baud rate of S32K144 under the current clock configuration.
You need to measure the signal sent from outside by using oscilloscope too.
Try to ensure that the baud rate of both parties is close.

Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 Kudos

1,579 Views
Vinod_Chinthoti
Contributor II

Hi @Robin_Shen ,

i did what you told and i am attaching oscilloscope measurement images.

i observed when sending data(0xAA,0x55) from microcontroller to terminal the baudrate is 115200.

and sending data from terminal to microcontroller some times observed baudrate is 1152800.

here i am attaching oscilloscope observations. https://drive.google.com/drive/folders/1E0l07fiagE0OkcGvWU2ckqUx59hrm0Hp?usp=sharing 

0 Kudos

1,547 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

From the oscilloscope, the baud rate of Terminal to microcontroller is within an acceptable range(115280).
If you have logic analyzer, then you can connect it at the RXD pin of S32K144, check if the UART signal is correct.
Would you please sent a simple test project, and tell me how to reproduce this problem. So that I can test it on S32K144EVB board.

By the way, I don't know the feature of this function:
Usart_Receive_Data_Interrupt(&uartPal1_instance,&RS_DataToRead,RS485_Bytes_To_Read);

If you are using UART PAL, then UART_Inint will install LPUART isr handler and enable LPUART interrupt in LPUART_DRV_Init.

uart_pal_echo_s32k144.jpg

Please refer the rxCallback of uart_pal_echo_s32k144.

rxCallback.jpg

0 Kudos

1,595 Views
Vinod_Chinthoti
Contributor II

HI Robin_Shen

thanks for reply. i will check what you said. my observation is when i am sending data from microcontroller to Docklight terminal it is working absolutely fine, no data mismatch is observed. but when i am send data from Docklight to microcontroller i am facing data mismatch issue. some time the information receiving properly, but some time not.

0 Kudos