I'm writing an ADC driver that does not use any provided NXP SDKs at the moment.
I can setup a handful channels.
But I only want an EOC interrupt to be triggered for one particular channel at a time. There's the CIMRx registers.
See attached adc_example.c for an example of the code I've written.
Solved! Go to Solution.
Hi,
to get an interrupt you need to set both CIMR (one or more bits) and MSKEOC. Then within interrupt you should clear asserted bits in CEOCFRx and EOC bit in ISR.
For bit clearing use register access. So instead of ADC_0.CEOCFR0.B.EOCCH11 = 1; use ADC_0.CEOCFR0.R = 1<<11;
In One-Shot mode (MCR[MODE] = 0), a sequential conversion specified in the NCMRn mask registers is performed only once. At the end of each conversion, an EOC interrupt is issued if enabled by the corresponding mask fields in CIMRn and IMR).
BR, Petr
Hi,
to get an interrupt you need to set both CIMR (one or more bits) and MSKEOC. Then within interrupt you should clear asserted bits in CEOCFRx and EOC bit in ISR.
For bit clearing use register access. So instead of ADC_0.CEOCFR0.B.EOCCH11 = 1; use ADC_0.CEOCFR0.R = 1<<11;
In One-Shot mode (MCR[MODE] = 0), a sequential conversion specified in the NCMRn mask registers is performed only once. At the end of each conversion, an EOC interrupt is issued if enabled by the corresponding mask fields in CIMRn and IMR).
BR, Petr