This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1294NCPDT: uDMA for data transfer from memory to GPIO

Part Number: TM4C1294NCPDT


I am trying to transfer data from memory  to GPIO  using uDMA.

My goal is to transfer a few bytes from memory (source) to PORTD (destination) using uDMA.

I am using tivaware_c_series_2_1_4_178 library.

I modified the  udma_demo.c  to  achieve the above.

When I try memory to memory transfer , it works fine. But when I change the destination address to GPIO PORTD, the uDMA interrupt does not get generated.

I have made the following changes .

// mem to gpio    ControlSet
uDMAChannelControlSet(UDMA_CHANNEL_SW | UDMA_PRI_SELECT,
UDMA_SIZE_8 | UDMA_SRC_INC_8 | UDMA_DST_INC_NONE |
UDMA_ARB_1);

// mem to gpio TransferSet

uDMAChannelTransferSet(UDMA_CHANNEL_SW | UDMA_PRI_SELECT,
UDMA_MODE_BASIC, g_ui32SrcBuf,(void *)( GPIO_PORTN_BASE+0x0),
MEM_BUFFER_SIZE);

I suspect the destination address I used  in uDMAChannelTransferSet  function may be wrong. How to specify this .correctly.

The Tivaware peripheral driver Library has the following note on page 592

Note:
When the GPIO_O_DATA register is the source or destination, the application code must
use the bit banded address space instead of specifying the source or destination address
as GPIO_O_DATA.

How to take care of the above?

Thanks in advance for your help.

  • Sorry. A small correction . The port is PORTN 

  • Ok. I figured out the way to do it by going through previous posts.

    The correct way to do it is:

    // mem to gpio
    uDMAChannelControlSet(UDMA_CHANNEL_SW | UDMA_PRI_SELECT,
    UDMA_SIZE_32 | UDMA_SRC_INC_32 | UDMA_DST_INC_NONE |
    UDMA_ARB_256);

    uDMAChannelTransferSet(UDMA_CHANNEL_SW | UDMA_PRI_SELECT,
    UDMA_MODE_AUTO, g_ui32SrcBuf,(void *)(GPIO_PORTE_AHB_BASE +0x3fc),
    MEM_BUFFER_SIZE);

    Looks like I can do the above only for ports A to J. 

    Now the data is appearing on PORTE and it is pretty stable with respect to multiple  requests (No jitter).

    A related question is how can I transfer 16bits of data from memory to two adjacent ports say E and F with a single uDMA trasfer.

    The idea is to make an raster graphic LCD driver using TM4C1294NCPDT  which does not have an LCD peripheral.

    Thanks for any help. 

  • Hello Krishna,

    The uDMA supports memory-to-memory, memory-to-peripheral, and peripheral-to-memory transfers, but not peripheral-to-peripheral transfers, so you would not be able to do it in a single DMA transfer. It would take two transfers to do so.

    Best Regards,

    Ralph Jacobi

  • Hi Ralph,

    I want to do  Memory to peripheral transfer not peripheral to peripheral.

    What I want is to transfer 2 bytes of data from memory to two ports (say E and F) simultaneously.

    This is required if I want to transfer a single pixel 16bit RGB data to  LCD display.

    Is there a way to do it?

    Best Regards,

    Krishna

  • Hello Krishna,

    No it would not be possible to do it 100% simultaneously, it would be back-to-back. The bus architecture would not allow writing to different register locations in the same CPU cycle.

    Best Regards,

    Ralph Jacobi

  • Thank you Ralph for the clarification. I suppose I have to use a fifo outside the microcontroller to synchronize the 2 bytes from 2 ports.j

    Can you please give any references to a design to drive raster  graphic LCD with TM4C1294NCPDT?

    Best regards 

    Krishna 

  • Hello Krishna,

    If you mean the actual hardware interfacing, we don't have anything like that since usually customers will use our LCD Controller peripheral or SSI.

    As for the graphics part itself, that is provided in TivaWare as the Graphics Library. There is a lot of documentation for it in TivaWare. We are working on a new app note on the topic as well but not sure how soon it will be available.

    Best Regards,

    Ralph Jacobi

  • Hi Ralph,

    I have another question. What is  the fastest achievable response time for a  uDMA request from PORT pin to availability of data at another port when we trigger a memory to GPIO single request transfer.

    I did an experiment on the EK_TM4C124XL  to transfer data from memory to PORTB with a request from PORTE Pin0 using uDMA.

    My observation is that it took 100ns from the falling edge of PORTE Pin0 to the data change at PORTB for single transfers(BASIC MODE).

    In AUTO mode the first transfer still took 100ns and the subsequent transfers at 50ns per byte.

    The CPU frequency is set to 120MHz.

    Question is, is this the best transfer rate we can achieve in uDMA for TM4C1294? If there is a way to improve this , how to do it.

    Ideally I would like to get a transfer rate of 40ns per byte for single requests. 

    Thanks in advance.

    Best Regards.

  • Hello Krishna,

    That is in the range of the timings I would expect for the DMA. There isn't really any ways to speed up the uDMA.

    If that is a hard requirement, I don't think it will be possible to meet it without external circuitry. As mentioned all customers use either SSI or LCD controller for this sort of application.

    This about the time between transition and not necessarily the actual data output right? If so, maybe you could use some external buffer ICs? That's what I'm thinking of when it comes to external circuitry.

    Best Regards,

    Ralph Jacobi

  • As mentioned all customers use either SSI or LCD controller for this sort of application.

    Hi Ralph,

    I am trying to drive a raster LCD display with 4 bit per pixel  using the RAM of TM4C1294. A resolution of 800x480  will do(192KB of frame buffer. This gives a double buffer option inside the RAM of micro controller). You suggested SSI. Is it quad SSI that you mean? Can I configure QSSI in uDMA to generate the pixel clock and 4 bit data to drive a raster LCD?

    Best Regards.

  • Hello Kumar,

    With SSI or Quad SSI, customers drive an external LCD controller IC that receives pixel data via SSI and then converts that to parallel outputs for the LCD along with clock and control signals. If the LCD controller peripheral is not used, that is the recommended way to interface with a raster display.

    Best Regards,
    Ralph Jacobi