LpUart Send Data Problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LpUart Send Data Problem

1,826 次查看
玉敏111田
Contributor III

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.pastedImage_1.png

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.

pastedImage_5.png

pastedImage_2.png

0 项奖励
回复
1 回复

1,638 次查看
dianabatrlova
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复