ADC noise canceler

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The datasheet tells all, but anyway we needed 4 days and some emails to Atmel's support:
Because we have a battery-powered device, we wanted so use power-down-modes as often as possible.
We wanted to make several ADC-samples within some ms. For the delay we decided to use TIMER0-overflow, setting the MCU to idle-mode. Since the delay was very short, we decided not to turn off ADC during the delay.
If ADEN=1, than everytime MCU enters idle-mode (not only ADC noise reduction mode) a convertion will be started. This results in generation of two interrupts (one convertion ready, one timer overflow) which interrupted the delay-routine (wrong delay) and the following ADC (wrong result)...
So be sure to disable ADC (ADEN=0), whenever entering one of the sleep-modes.
/Martin.

P.S.: We use an ATmega48 (but the same behaviour will occure on any other AVR)

/Martin.