Groups | Search | Server Info | Login | Register


Groups > comp.arch.embedded > #32280

Re: ATmega328PB and ADC

From David Brown <david.brown@hesbynett.no>
Newsgroups comp.arch.embedded
Subject Re: ATmega328PB and ADC
Date 2024-11-20 17:23 +0100
Organization A noiseless patient Spider
Message-ID <vhl2dj$5veu$1@dont-email.me> (permalink)
References <vh230f$23hme$1@dont-email.me> <vhk7aa$2fm1q$1@dont-email.me>

Show all headers | View raw


On 20/11/2024 09:40, pozz wrote:
> Il 13/11/2024 12:36, pozz ha scritto:
>> I couldn't understand if the first conversion after ADC is enabled 
>> (ADEN bit) must be discarded or not.
>>
>> The datasheet suggests to discard the first conversion result after 
>> changing the reference signal, but nothing after enabling ADC or 
>> changing input signal (ADMUX).
>>
>> The only note is about the conversion time that is longer for the 
>> first conversion after ADC is enabled.
>>
>> I'm asking this question because I'm noting a different behaviour if I 
>> start conversion and enable ADC at the same time for each conversion 
>> against leaving ADC enabled and starting only the conversion (ADSC bit).
> 
> For the future readers, I found my issue. Occasionally I put the MCU in 
> sleep mode after enabling ADC and starting conversion. Even if ADC clock 
> still runs in this mode, the result is not good.
> 

It is a while since I have used AVRs, but it sounds to me like you are 
doing something wrong.  You should get /better/ results if you put the 
micro to sleep immediately after starting a conversion.  This is a 
well-established technique for getting higher accuracy from small 
microcontroller ADCs, as you reduce the general digital noise in the 
system.  But you might have to pick the right kind of sleep mode.

Back to comp.arch.embedded | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

ATmega328PB and ADC pozz <pozzugno@gmail.com> - 2024-11-13 12:36 +0100
  Re: ATmega328PB and ADC pozz <pozzugno@gmail.com> - 2024-11-20 09:40 +0100
    Re: ATmega328PB and ADC David Brown <david.brown@hesbynett.no> - 2024-11-20 17:23 +0100
      Re: ATmega328PB and ADC pozz <pozzugno@gmail.com> - 2024-11-21 08:28 +0100
        Re: ATmega328PB and ADC David Brown <david.brown@hesbynett.no> - 2024-11-21 09:00 +0100
          Re: ATmega328PB and ADC pozz <pozzugno@gmail.com> - 2024-11-21 09:04 +0100

csiph-web