AnsweredAssumed Answered

Measuring the ADC amplitude with K32L2B

Question asked by Eric Smith on Jun 8, 2020

I'm working with the FRDM-K32L2B3 kit and I'm trying to measure the amplitude/crest of a wave that lasts approximately 1μ. There is up to 2k samples per second. What's the best strategy here?


The goal is to trigger a capture when the signal hits a threshold then sample for 1μ or until the signal begins to decrease when it hits the peak. The highest value is what I'm after.


I've tried using the CMP to trigger an ADC conversion and interrupt but the values seem all over the place. I've tried modifying the adc16_continuous_dma example but it doesn't seem to capture the full wave, just one value.


The ADC operating conditions table lists a max conversion rate of 1200 ksps so does this mean I'm limited to one sample every 0.8μ? If this is the case I might not be able to sample the first half of the wave to catch the peak.


Does anyone have some pointers? Much thanks!


Here are the options I've used for adc16_continuous_dma example:

    adcUserConfig.clockDivider = kADC16_ClockDivider1;
    adcUserConfig.resolution = kADC16_ResolutionSE10Bit;
    adcUserConfig.clockSource = kADC16_ClockSourceAlt0;
    adcUserConfig.enableContinuousConversion = true;
    adcUserConfig.enableHighSpeed = true;


Edit: After closer examination it turns out that the ADC values on the CMP trigger do correlate with the peaks somewhat. Thanks for the words of advice.