cancel
Showing results for 
Search instead for 
Did you mean: 

UART_INTERRUPT Vs UART_DMA

kalpana lopinti
Associate II
Posted on January 17, 2018 at 08:46

what is the difference between UART INTERRUPT MODE and UART_DMA MODE.what is the best procedure to use when i want to work with data stream received from modules like gps,where specific data length is not known exactly.

can some body tell me the specific application applicable to both of them.(when to use Interrupt and when to use DMA)

Note: this post was migrated and contained many threaded conversations, some content may be missing.
12 REPLIES 12
Posted on January 17, 2018 at 21:37

The OP's issue with GPS NMEA sentences is the elastic nature of the data length, then sentences themselves are easy enough to frame and pass along to processing. The bursty and periodic nature means that a fixed buffer request might take an additional second to clear, and screw with the latency. u-Blox, among many others, have binary formats too which have more rigid lengths and formatting.

Thedata loss with GPS can frequently occur when trying to jam more than ~960 characters down the pipe at 9600 baud. Easily done with the now highly populated constellations and a handful at once.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Pavel A.
Evangelist III
Posted on January 18, 2018 at 12:13

Back to the original question... We seem to agree that RX is better done with interrupts. But sending out long strings/buffers without flow control may be done with DMA. 

-- pa

Posted on January 18, 2018 at 13:40

I would not claim to be an expert but I would put it slightly differently.

If the overheads of the interrupt routines are not important then I would use interrupts for both RX and TX. Simple to implement and understand.

If overheads become and issue then yes, DMA for transmitting is a fairly easy way of reducing them. As long as you consider the consequences.

If things are really tight then DMA could be used for reception too but it does complicate things a little more.

There is some info on rx using DMA here....

https://community.st.com/0D50X00009XkW2nSAF