Hi!
I am using MKE14F512VLH16 microcontroller with the latest MCUXpresso IDE.
I need to read multiple ADC channels periodically so I think that the most eficient solution is to trigger ADC readings using a PIT timer.
The problem is that I can only start one convertion at once so maybe using eDMA to launch multiple channel readings is the way to do it.
So I have the PIT Timer triggering the eDMA transfer from a vector where I have the ADC channel that needs to be read to the ADC0 Status and Control Register 1.
Then I have a eDMA to copy the result of the ADC convertion to a vector of results.
But it seems to not be workins since I dont see value of the channels to read get loaded on the ADC SC1 register. I thing it is a problem on my eDMA configuration or in the PIT triggering configuration.
The configuration is the next.
For the PIT Perihperal and pit trigger multiplexing:
Then the configuration of the ADC is:
An the DMA:
DMA Ch0:
/* Enable ADC channel 2 configuration - 0x10 , 0x11 */
AT_NONCACHEABLE_SECTION_INIT(uint32_t adc_trigger[2]) = {10U, 11U};
DMA Ch1:
/* Result buffer with ADC measurement output */
AT_NONCACHEABLE_SECTION_INIT(uint32_t ADC_RESULTS[2]) = {0};
Hello,
I suggest downloading the SDK of the FRDM-KE15 this has some examples with the ADC, I mean you can port to your target.
Best regards,
Pavel