MCU:S32K144
Uart baudRate;9600
when MCU recieved buffer[9]={11,22,33,44,55,66,77,88,99},it would send buffer it recieved.
But when uart baudRate was 115200,it could't send buffer[9]={11,22,33,44,55,66,77,88,99},it sent {11,22}。
So I could not unstand.
My board was used external oscillator 16MHZ.Uart's CLOCK was 8MHZ.
Hi,
The issue looks like data register overflow.
Receiver Overrun Flag (OR) is set when software fails to prevent the receive data register from overflowing with data.
While the OR flag is set, no additional data is stored in the data buffer even if sufficient room exists.
To clear OR, write logic 1 to the OR flag.
Could you please check the flags in the LPUART Status Register? Is OR flag set?
For detailed information see chapter 51.3.1.7 LPUART Status Register (STAT) in the Reference Manual.
How to prevent overrun:
- Decrease the BaudRate value
- Set the higher priority of LPUART interrupt
- Choose the fastest clock source for the LPUART
- You can consider the use of FIFO register see 51.3.1.12 LPUART FIFO Register (FIFO) in the Reference Manual.
There can be set the maximum number of receive data words that can be stored in the receive buffer before an overrun occurs.
I hope it helps you.
Best regards,
Diana