Re: ATmega328PB and ADC

Liste des GroupesRevenir à ca embedded 
Sujet : Re: ATmega328PB and ADC
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.arch.embedded
Date : 20. Nov 2024, 17:23:15
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vhl2dj$5veu$1@dont-email.me>
References : 1 2
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
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.

Date Sujet#  Auteur
13 Nov 24 * ATmega328PB and ADC6pozz
20 Nov 24 `* Re: ATmega328PB and ADC5pozz
20 Nov 24  `* Re: ATmega328PB and ADC4David Brown
21 Nov 24   `* Re: ATmega328PB and ADC3pozz
21 Nov 24    `* Re: ATmega328PB and ADC2David Brown
21 Nov 24     `- Re: ATmega328PB and ADC1pozz

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal