AnsweredAssumed Answered

DMA / SPI with GPIO trigger on K64

Question asked by Mikael Elharrar on Oct 7, 2017
Latest reply on Oct 18, 2017 by Butcher

Hi Community,

 

It is the fifth post I write on this subject (DMA/SPI/GPIO trigger) and I didn't yet succeeded to close my issue.

 

I have an external ADC ( ADS121A02 from TI ) connected through SPI0 to my K64 microcontroller.

 

On this ADC, each time the both channels are ready to be read ( ADC is configured as slave and K64 as master), a GPIO pin ( called NRDY ) is asserted to logical level 0.

 

In order to not disturb the microcontroller each time a new sample is ready ( I have to reach 48KSample / sec), I would like to trigger the DMA automatically and get an interrupt each 32 new samples.

 

Each new sample, the SPI should output 12 bytes (4 bytes status, and 2 channels x 4 bytes each).

 

I configured the SPI TX to be triggered by the GPIO, and SPI Rx to pick an interrupt each 32 samples.

 

Unfortunately, when I configure my DMA to be triggered by an external GPIO, the SPI doesnt output any signal ....

I checked with a scope, and SCK/MOSI and  MISO are not performing the transfer at all, BUT the internal counter of the DMA was decreased (as expected).

 

I publish here my code. If someone can help / tell me what is wrong into it, it will be very nice.

 

It done with KDS.

 

Thank you all

Original Attachment has been moved to: hello_world.zip

Outcomes