S32K311 UART Timeout

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K311 UART Timeout

399件の閲覧回数
kiran5
Contributor I

Hi NXP Team,

I am using S32k311 MCU board UART peripheral for LIN communication.

I would like to use the timeout functionality in the UART peripheral.

In my application i am using 19200 baud rate. 

My LIN frame consists of a header, 8 byte data and Checksum.

After receiving the first byte i want to start the timeout value till i receive checksum.

As i have configured 19200 as baud rate the total time for receiving the complete frame till checksum will be 4680 microseconds.

9 bytes ( 8 data bytes and one checksum). Each bit is 52 microseconds and each byte as 10 bits. so total time is 4680 micro seconds.

This is the configuration i am doing.

LIN_REG.TOCR.B.TOIE = 1; //timeout 0 interrupt enable
LIN_REG.TOSR.B.TOF = 1; // Clear interrupt flag
LIN_REG.TIMEOUT[0].B.CFG = 3; //reset the timeout count to 1
/* Set the timeout value */
LIN_REG.TIMEOUT[0].B.TIMEOUT = 8000;// timeout value
/* Enable the TIMEOUT0 counter */
LIN_REG.TOCR.B.TOEN = 1;

 

I would like to know how the timeout value is to be written in the LIN_REG.TIMEOUT[0].B.TIMEOUT register. for 4680 micro seconds what value should be written or how it should be configured.

 

Thanks

Kiran

 

0 件の賞賛
返信
1 返信

358件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

timeout counter monitors idle time in number of bits. So if 9 bytes should be checked, then LIN_REG.TIMEOUT[0].B.TIMEOUT should be min 90. Probably little bit more assuming there can be any additional inter-byte space in LIN frame. 
You need to set the extended idle feature for this mode as well, configuring REIR register. This must be greater then configured timeout.

BR, Petr

0 件の賞賛
返信