1.6 ADC Noise Canceler
The ADC of the megaAVR has a noise canceler that enables conversion during sleep mode, which reduces the noise induced from the CPU core and other peripherals. This feature is available in the ADC Noise Reduction and Idle mode. To use this feature:
- Ensure that ADC is enabled and not busy converting. Single conversion mode must be selected and the ADC conversion complete interrupt must be enabled.
- Enter ADC noise reduction or idle mode. The ADC will start a conversion once the CPU has been halted.
- If no other interrupts occur before the ADC conversion completes, the ADC interrupt will wake-up the CPU and execute the ADC conversion complete interrupt routine. If another interrupt wakes up the CPU before the ADC conversion is complete, that interrupt will be executed, and an ADC conversion complete interrupt request will be generated when the ADC conversion completes. The CPU will remain in active mode until a new sleep command is executed.