9 years, 2 months ago.

Sample using ADC, DMA, and a Timer

I have been working with the FRDM-k64f all week to setup sampling using a timer to trigger the ADC, and then the ADC triggers the DMA to save the value in memory. So far I have the ADC working with the DMA, but I can't seem to get any timers to trigger the ADC. I have attempted to trigger the ADC using a PIT and a PDB (not at the same time obviously). Has anyone attempted something like this or does anyone have example code?

I believe I setup the DMAMUX, and the ADC trigger selection in the SIM_SOPT7. Any help is appreciated.

Question relating to:

The Freedom-K64F is an ultra-low-cost development platform for Kinetis K64, K63, and K24 MCUs.

which pta channel are you using? Because us ticker in mbed uses PIT , 2 channels as I recall. You can share the code, without the code, its just guessing game.

posted by Martin Kojtal 30 Jan 2015

Mbed now uses all 4 PIT channels, two for wait, two for ticker. So if you are also using any functions which use mbed wait it will setup the PIT channels for that.

posted by Erik - 30 Jan 2015

I finally figured it out. To use the PDB, I needed to put ADC0 to trigger B, and ADC1 to trigger A because I'm triggering them both at the same time.

posted by Joey McElderry 03 Feb 2015

1 Answer

9 years, 2 months ago.

As Erik commented, don't use PIT if you use mbed API timers , wait(), Ticker, Timeout and the rest.

Why to use mbed irqs instead of hardware modules (PIT)? sorry for the unknown

posted by fede blanc 07 Feb 2018