AnsweredAssumed Answered

AN3070 : Is DMA transfer complete interrupt needed?

Question asked by king.derek on May 27, 2013
Latest reply on May 31, 2013 by king.derek
Application note AN3070 describes a procedure for releasing RS485 bus when using DMA to transfer USART data.   The procedure uses two interrupts:
  * DMA transfer complete (DMA_TC) interrupt 
  * USART transfer complete (USART_TC) interrupt.

In the app note, the DMA_TC is used to enable the USART_TC interrupt and the USART_TC interrupt is use to release the RS485 bus.  

However, the DMA_TC interrupt seems unnecessary.  I have code that only uses the USART_TC interrupt and works just fine.  Is there some subtle reason for using the DMA_TC interrupt to enable the USART_TC interrupt?

Here's my pseudo code that does not use the DMA_TC interrupt:

  init_dma(); //sets DMA type and direction but does not enable DMA

void rs485_write(uint8_t *data, int len)
  DMA->NTDR = len;
  DMA->M0AR = (uint32_t)data;

void usart_tc_isr()
   asm("nop"); // Adds a tiny bit of delay after clearing USART_TC that prevents interrupt from being re-entered immediately after returning

Link to app-note: