IMXRT1024 UART Data Transmission by Byte vs Interrupt Mode

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

IMXRT1024 UART Data Transmission by Byte vs Interrupt Mode

Jump to solution
654 Views
Lukas_Frank
Senior Contributor I

My question about data transmission process of UART. There are a few couple of methods to send/receive data in codes as uart architecture with NXP like belows:

  • LPUART_WriteByte : Write data to the register buffer
  • LPUART_ReceiveByte: read data from the register buffer
  • LPUART_WriteBlocking: polling mode
  • LPUART_ReceiveBlocking: polling mode
  • LPUART_SendEDMA: DMA mode
  • LPUART_ReceiveEDMA: DMA mode
  • LPUART_TransferSendNonBlocking:interrupt mode
  • LPUART_TransferReceiveNonBlocking:interrupt mode[Reference Link] 

I just want to avoid delays in my code design. I do not want to UART transmission block other process in my code. What is the difference between Byte vs Interrupt mode.

 

Byte Mode : (LPUART_WriteByte and LPUART_ReadByte)

Interrupt Mode : (LPUART_TransferSendNonBlocking and LPUART_TransferReceiveNonBlocking)

 

Thanks and Regards.

 

0 Kudos
1 Solution
637 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
1) Will it block other operations when I use Byte Mode?
-- No, it's not sure, as the MCU executing either LPUART_WriteByte or LPUART_ReadByte function, it may interrupt other functions or APIs.
However, it won't interrupt other peripherals' operations if they use either interrupt mode or DMA mode.
Have a great day,
TIC

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

View solution in original post

0 Kudos
3 Replies
646 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
According to your statement, I think the Interrupt and DMA modes are a better choice for your design, and if transmit a fixed and large amount of bytes per time, you'd better prefer the DMA mode, otherwise, the interrupt mode is a good one.
To learn the differences among the above APIs, I'd highly recommend reviewing the code.
Have a great day,
TIC

-------------------------------------------------------------------------------
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
643 Views
Lukas_Frank
Senior Contributor I

Hi Dear @jeremyzhou,

 

I was wonder about, will it block other operations when I use Byte Mode?

 

Thanks and Regards. 

0 Kudos
638 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
1) Will it block other operations when I use Byte Mode?
-- No, it's not sure, as the MCU executing either LPUART_WriteByte or LPUART_ReadByte function, it may interrupt other functions or APIs.
However, it won't interrupt other peripherals' operations if they use either interrupt mode or DMA mode.
Have a great day,
TIC

-------------------------------------------------------------------------------
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