I am pretty new to the KDSK and the EDMA peripheral and its concepts on how it fits all together. It's a pretty steep learning curve.
What I need is:
I have the ADC's running with interrupts and triggered by the PDB on a slower rate, but now I need to get the ADC triggering the DMA and transfer into buffers.
So how do I set that up? I am a bit lost in the KSDK API functions. The describe very well what all the parameters are but not in which order they need to be setup and how it all fits together.
So far I think I have a handle on:
But how do I setup these transfer descriptors and links to do what I want?
Anybody can provide a few lines of a sample code or a pointer to sample code on how to do this using the KSDK API functions?
Hi Marco,
I am stuck with the same problem as yours !
Have you found something about that ?
Do you have any project example available ?
Thank you,
Maurice
Attached a bit of code extracted from my project that should put you on your way.
In the ADC it still seems to enable the callbacks, but that was mainly there for debug
to see if the ADC was firing. With the EDMA running that can be removed.
Good luck. It was a steep ride for me too.
Marco
Hello Marco,
Thank you very much for sharing this !
It looks that you haven't use Processor Expert to generate the code for ADC using DMA, is that right ?
I have investigated into the components of Processor Expert for KDS and it makes me confusing about the use of it...
First, there are Init_ADC and fsl_adc components for the ADC. One should use fsl_adc to get the code for callback and trigger mode.
But fsl_adc is too simple to init properly the ADC... Init_ADC is suitable for this, but it is not possible to join Init_ADC and fsl_adc together (they share the same peripheral and an issue is generated by PE).
It is like the Processor Expert version for KDS is not finished yet. PE for CodeWarrior is much more advanced... It is possible to set all the parameters in LDD_ADC.
Anyway, I have to go on with my project using KDS and I will write "by hands" the necessary code for the ADC transfert involving DMA.
It is a pity to spend time for this ! And there is no code example for that, and no documentation too...
Thanks again Marco.
Maurice
Hi Marco,
Several demo examples are delivered in the KSDK.
There are examples for ADC, eDMA, GPIO, etc ...
Please have a look under \KSDK_1.0.0\demos installation folder.
For documentation , please have a look to:
\KSDK_1.0.0\doc\Kinetis SDK Demo Applications User's Guide.pdf
\KSDK_1.0.0\doc\Kinetis SDK API Reference Manual.pdf
Have a great day,
Pascal Irrle
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Pascal,
Looking at the \KDS_1.1.1 and \KSDK_1.0.0, I see no examples involving an ADC and DMA transfert with Processor Expert components...
I don't see clearly if I have to use fsl_adc and fsl_edma or just the INIT_ADC and INIT_eDMA...
What about the PDB component since Dma request is set for ADC and DMA ? Is it necessary to instance a PDB component ?
An exemple would be MUCH appreciated since I haven't found any document about the use of Processor Expert for KDS.
Thank you,
Maurice