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.

GPIO triggered SPI DMA

Other Parts Discussed in Thread: OMAPL138

Hi,

  I am connected to a 31 bit ADC over the spi1 interface.  Every 500us I get a data ready pulse from the ADC.  On the negative edge of the pulse, I need to transmit 4 bytes of data out the spi.  The ADC is set to 2000 sps so the 4 byte transfer occurs 2000 times a second.  On my receive end, i am capturing the 4-byte 2000 samples into a buffer.  My transmit dma configuration uses EDMA channel 7 which is associated with GPIO 1[2].  My receive edma uses channel 18 which is spi1 receive.  I have not been able to get more than 1 byte of data coming out the transmit buffer every 500us.  I have a scope on the sclk to verify data transmission.  Attached is the edma support file and the spi file.  What else can I be forgetting?

Will

0535.spiSupport.zip

  • Hi Will Resnick,

    Please provide the following details

    1. Which processor you use?  C6748 or OMAPL13x ? ( It seems to be C6748 as per the code you attached, but not sure whether you are using DSP (C6748) of OMAPL138

    2. The code, you attached here is your own code or supplied from TI? If the code is part-of any SDK, mention the version details as well.

    3. What are you actually trying to do using ADC, SPI, EDMA?

    Regards,

    Shankari.

  • Hi Shankari,

      I am using the C6748.  The code I attached is my own, taken from the edma example from the pdk_C6748_2_0_0_0.  The ADC sends out a data ready pulse every 500us.  On the negative edge of the pulse, data is ready.  The data pulse is tied to GPIO bank 1 pin 2.  I have configured the dma engine to trigger off a GPIO 1 interrupt.  Every interrupt I need to transmit 4 bytes of dummy data to the ADC in order to get back 4 bytes of valid ADC data.  I believe I have set up my dma SPI1 rececive channel correctly.  For some reason, I am not able to transmit 4 bytes of dummy data to the ADC via dma every time the GPIO bank 1 interrupt occurs.  I have only been able to transmit 2 dummy bytes.  I would think that this functionality is possible with the dma engine since it seems pretty commonplace for interfacing with an ADC.

    THanks,

    Will

  • Hi,

      Any updates?  Have you been able to reproduce the issue?

    Will

  • I believe I know how to do this but I am unable to use the DMA to write to the EESR register in shadow region 1.  Let me know if my logic is correct.

    1) Have my GPIO EDMA enabled using EESR and my SPI EMDA param set configured to send 4 bytes of data

    2) when I enable my GPIO interrupt, the GPIO EMDA is called.

    3) The GPIO EDMA will write 0x00080000 to the EESR which enables the SPI EDMA.

    4)  After the SPI EDMA completes, it links to writing 0x00080000 to the EECR which disables the SPI EDMA.

    I am having trouble writing 0x00080000 to the EESR register.  It never seems to load the value.

  • Just found my problem and everything works now.  I was writing a value for param6 and the source was its address.  I reused the same variable for the param19 write val and because it was the same variable, it reused the same address.  Both params were using the same variable but it was now incorrect for param6.  made separate write variables for each param set and now it works.

    Will