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.

CC3200 DMA pingpong

Other Parts Discussed in Thread: CC3200

I am making a SPI communication program for CC3200 using DMA, pingpong and TIRTOS. The problem is, that there are no examples. I have copied the transfer part from I2SCC3200DMA.c and it seems to work. Now I had to make the interrupt function and that can also be found in I2SCC3200DMA.c . I would like to understand how it works, but it uses function MAP_uDMAIntStatus (uDMAIntStatus) and that is not documented, well. I am inclined to think, that MAP_uDMAIntStatus() & 0x00000020 has something to do with transmit, FIFO or DMA and MAP_uDMAIntStatus() & 0x00000010 with receive, but where are these hex numbers defined, what do they mean.

In additon, the function uses pControlTable, as TIRTOS programs should, but what are the bits in ulControl. If I am right, this table should no be read directly, so where are the functions to read the table.

SPICC3200DMA.c uses also TIRTOS, but uses MAP_SPIIntStatus() in spiHwiFxn.

udma_demo.c uses ROM_UARTIntStatus, but is not TIRTOS(?)

DmaControlTable is defined in CC3200_LAUNCHXL.c and also set, but not referenced anywhere.

Which one is the right one to use, should I use ControlTable, how, or can I read the registers directly, where to get more information.

Best regards,

Pauli

  • Pauli,

    If I understand you correctly, you wish to implement SPI and I2S using the DMA?

    You may notice in the CC3200_LAUNCHXL.c file the config structures defined under the I2S and SPI headers. These structures are used by I2SCC3200DMA.c and SPICC3200DMA.c respectively.

    Using the top level implementations of the drivers (I2S.h & SPI.h) will implement the I2S DMA and SPI DMA drivers.

    Below is an short example. Note that this example will use SPICC3200DMA.c due to the structures defined in CC3200_LAUNCHXL.c.

    SPI_Handle spi;
    SPI_Params spiParams;
    
    SPI_Transaction spiTransaction;
    uint8_t         transmitBuffer[BUFSIZE];
    uint8_t         receiveBuffer[BUFSIZE];
    bool            transferOK;
    
    SPI_Params_init(&spiParams);
    spiParams.transferMode = SPI_MODE_CALLBACK;
    spiParams.transferCallbackFxn = UserCallbackFxn;
    
    spi = SPI_open(Board_SPI0, &spiParams);
    
    if (spi == NULL) {
        // Error opening SPI
    }
    
    spiTransaction.count = someIntegerValue;
    spiTransaction.txBuf = transmitBuffer;
    spiTransaction.rxBuf = receiveBuffer;
    
    transferOK= SPI_transfer(spi, &spiTransaction);
    
    if (!transferOK) {
        // Unsuccessful SPI transfer
    }
  • There was a suggested answer and since there has been no active on this thread for more than a week, the suggested answer was marked as verify. Please feel free to select the "Reject Answer" button and reply with more details.
  • Thank you Derrik for your reply. I have been busy with another project so this is a little late.

    I had time during the weekend to take a new look at the SPI pingpong program and it is not at all so complicated as I thought. I2S example was not a good starting point, SPICC3200DMA.c works fine. Even though the ControlTable must exist, you do not have to take care of it.

    After all the biggest problem was to find out, when to disable CS. I am using the SPI with several devices, so I have to control the device select signals by my self. SPI_INT_TX_EMPTY seemed to be a good condition, but somehow I could not get that interrupt. Finally I found out, that EOT is enough (?) to disable the CS, although in SPICC3200DMA.c, there is a more complicated condition.

    I spent quite a lot time trying to find out, what the bits in the control table mean and also what are the meanings of the DMA registers, just to learn later, that I do not need that information.

    I am not any more so sure, that pingpong is so good idea. It needs tens of lines of code and all in an interrupt routine. A lot easier and lighter load to the cpu would be a loop updating DMA controller. Throughput would be only a little lower, though.

  • Pauli,

    The top level driver implementations (SPI.c & SPI.h) are designed so you do not have to understand how SPICC3200DMA.c uses the under lying driver libraries.

    However, you are able to modify SPICC3200DMA.c & SPICC3200DMA.h as necessary but you will have to rebuild your drivers in your product. Alternatively, you could add SPICC3200DMA.c & SPICC3200DMA.h to your project and just include "SPICC3200DMA.h" and modify it there.

    Derrick