ADC interrupts occur under the following conditions:
In order to request an ADC conversion, you need to write into ADCx_SC1n. If you use a DMA channel to write into these registers, you need to consider that every DMA transfer will overwrite the contents of ADCx_SC1n configuration fields. So you need to make sure that the data you are transferring into ADCx_SC1n contains the “ADCH”, “DIFF”, and “AIEN” settings you want to keep.
This way you will be able to request conversions and maintain settings according to your application demands. If the ADC interrupt criteria is met, ADCn will trigger an interrupt upon conversion completion. Remember to read the Rn register inside your ADC_IRQ in order to clear the COCO flag and avoid being interrupted multiple times by the same conversion.
Thanks for your input.
Actually the problem was in DMA configuration, i was giving start command to only one channel because of which i was not able to get the expected functionality.
I am facing a different issue now.
I am trying to verify the perfomance of ADC in this DMA ADC linking configuration but i am getting strange observations. I have applied 1.6V DC to 3 channels of ADC(i.e. Channel 8, channel 9 and channel 15) without any ripple(2 mV ripple observed on digital oscilloscope.Also there is no ripple on VDD.I haveconnected 0.1 uF on all the channels.
1) Testing on Personal computer, fluctuation in ADC o/p is 17-21 counts on all the channels
2) Testing on Laptop, fluctuation in ADC o/p is 2-4 counts on all the channels
I have never experienced this for other microcontrollers.
What could be the reason for this strange behavious and how do i test the performance of ADC?
Thanks and best regards,
No problem. I am glad to hear that you could solve the sampling issue.
Regarding the noise you are receiving on your signal, are you using one of our boards?
I found an AppNote about increasing ADC accuracy that may come handy. Here you will find the link to it: https://cache.nxp.com/docs/en/application-note/AN5250.pdf
Also, I suggest consulting our Kinetis Peripheral Module Quick Reference: https://cache.freescale.com/files/32bit/doc/quick_ref_guide/KQRUG.pdf
There you will find the steps to configure the ADC according to you application’s demands, as well as example bare-metal code that may help set your system for low noise conversions.