AnsweredAssumed Answered

ADC Scan operation in K22F

Question asked by Prasanna Naik on Jun 28, 2019
Latest reply on Jul 9, 2019 by Javier Camino



I want to use K22F series controller in a control application wherein i need to sample 12 ADC  channels on one trigger.

Basically i want  to use 2 DMA channels and ADC for this purpose. One DMA channel will put channel data into SC1A register of ADC. ADC will be configured in SW trigger mode and will give the output once SC1A contains channel information. The second channel will be used to store the result of ADC into a RAM buffer. I have referred  "Using DMA to Emulate ADC Flexible Scan Mode with SDK 2.x" but this application note has slightly different configuration. In application note, ADC is hardware triggered and channel data changes only on timer interrupt. So to sample 12 chanels 12 Timer interrupts will be needed. Thats why i am planning to use software trigger mode of ADC to sample 12 channels on one Timer interrupt whereing DMA sequencing will be started.

I have modified the code accordingly to sample 3 channels but it is not giving ADC interrupt. I couldn't figure whats wrong'. I have attached the code for reference. Please help.