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
Hi,
Could you provide the eDMA Channel 0 TCD configuration value (registers value) for DSPI0 TX?
From your code, I find the DSPI0 related pins setting and DSPI0 setting correctly.
I want to make sure the GPIO trigger eDMA will transfer the correct value to SPI0_PUSHR register for SPI0 transmit.
Thank you.
Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------