This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LPC1769 UART selective DMA operation(between RX and TX)

Hello All,
This is not a KEIL related question.
I decided to cross post here(and lpcware) as I get good responses here.

I wish to use GPDMA for asynchronous UART communication from a ring-buffer.

UART TX DMA is straightforward.

Now, UART RX DMA needs to know size of bytes to be received. To receive variable sized transfers, I plan to use a timer with duration of say 16 bytes. On each timer expire interrupt, I will check the transferSize value(control register of DMA channel used for UART DMA Rx). If the value is changing, just reload the timer to check again. If the value is unchanging call a RxCallback function.

What I wish to do is selectively enable and disable UART RX DMA.
- So UART Rx interrupt(non DMA) will be enabled to begin with.
- If any byte received, in the receive interrupt set up a DMA desc of maximum expected size, disable UART Rcv interrupt and enable timer.
-When transferSize stops changing, stop DMA, disable timer, reenable UART Rcv and call RxCallback function.

User manual UM10360 is incomplete in describing GPDMA operations. I have used PL080 as reference. Now
UM10360 says in section '14.4.6.1 DMA Operation' (pg 314, Rev. 3.1 2/4/14)

The user can optionally operate the UART transmit and/or receive using DMA. The DMA
mode is determined by the DMA Mode Select bit in the FCR register. This bit only has an
affect when the FIFOs are enabled via the FIFO Enable bit in the FCR register.

But there is only one bit to select FIFO and DMA modes. They affect both UART RX and TX. I cannot find any reference to how to selectively enable/disable UART RX dma. Does anyone have other ideas?

In absence of selectively controlling RX UART DMA, one option is to reserve a DMA ch for it, keep timer running always and use above logic for callback. I would prefer to not have timer interrupts all the time. If anyone has implemented a similar scheme, please elaborate.