USART interrupt exampls

显示  仅  | 搜索替代 

USART interrupt exampls

1,026 次查看
Contributor III

Recently I‘m writing the code for USART in interrupt mode,and I was refer to the examples of the SDK.But I can't find the Timing and Control aspect of the code。In other words, when send the last words to the FIFO,or other upper layer interrupt to react,how  much can I set the hold time to wait.

the second question:pastedImage_1.pngwhat the differences with this folders,and please told me if I want to write my code about USART with FIFO interrupt,which one can I refer to。

My MCU is LPC55S69,and my board is LPC55S69-EVK。

标签 (1)
标记 (1)
0 项奖励
1 回复

881 次查看
NXP Employee
NXP Employee



The differences in each folder are explained in the readme.txt of each example. You can find this document under the folder "doc" of each example. However I will give brief description of three principal ones.


  • The DMA_Transfer echoes the data sent every 8 characters. That means that it will wait until the 8 character is written to send the complete 8 characters back. In addition this example sends data using the DMA module. It is a non-blocking function, which returns right away.
  • The interrupt example will send back all the characters that are sent by the PC via UART. So essentially when an interrupt is triggered, the data is saved in a buffer. However in the main function there is a while loop which is checking the buffer, if there is data it sends it out.
  • The polling example is similar to the interrupt, except it is reading and writing in a cycle. The read function reads the RX register using a blocking method. It polls the RX register, waits for the RX register to be full or for the RX FIFO to have data and then read data from the RX register. The write function also uses a blocking method to write to the TX register. It  polls the TX register, waits for it to be empty or  for the TX FIFO to have room and writes data to the TX buffer.


From your description in your question, I believe you are referring to hardware flow control. Hardware flow control allows you to control when data can be sent or received with a sort of handshake. Basically on one side you have an RTS(Ready to send) signal which informs that they have data to send out. On the other side you have CTS(Clear to send) signal, and this informs that they are ready to receive. This way you have more control of the USART communication. You can find more information regarding this in Chapter 34 of the reference manual.


Please let me know if this answers your questions.

Have a great day!