MKE1xF512VLH16 lpuart RX interrupt

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

MKE1xF512VLH16 lpuart RX interrupt

996件の閲覧回数
shar2021
Contributor I

Hello,

              I have to implement a callback function for RX. I have a variable command which will be sent from terminal. For eg , in this data block can be 1 byte or 200 bytes and rest are fixed. 

STX , Address, SEQ Number, DataBlock(n), ETX, CRC. 

I am using Ring buffer method.

For now i am using the sample example of twrke18f_lpuart_interrupt_rb_transfer. The buffer is fixed to 8 , so it receives only 8 bytes. 

sendXfer.data = g_txBuffer;
sendXfer.dataSize = ECHO_BUFFER_SIZE;
receiveXfer.data = g_rxBuffer;
receiveXfer.dataSize = ECHO_BUFFER_SIZE;

I do get a complete data 

02 0x31 0x31 Z 0x03 0xCRC

I can not get variable frame ,For my example how do i trigger call back when ETX is received without depending on the size as above.

Attaching code files.

Please help with expert guidance

 

0 件の賞賛
返信
3 返答(返信)

976件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi shar2021,

Check the IDLE of "48.3.1.7 LPUART Status (STAT)".

48.3.1.7 LPUART Status (STAT) IDLE.png

You can enable the Idle Line Interrupt by ILIE of 48.3.1.8 LPUART Control (CTRL).

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 件の賞賛
返信

973件の閲覧回数
shar2021
Contributor I

Hello @Robin_Shen ,

                                 Thanks for response. I have question, Can ring buffer concept be used for variable length packet? I tried the interrupt mode too instead of ring buffer, I was unable to receive variable length packets.

Do you have any example for variable length frame?

Thanks  

0 件の賞賛
返信

933件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Sorry for the delay!
Have you test the twrke18f_lpuart_edma_rb_transfer?

twrke18f_lpuart_edma_rb_transfer.png

タグ(1)
0 件の賞賛
返信