Skip to main content
added digital stability section
Source Link

Analog Stability

From the Datasheet of ATMEGA328 Page 240:

When the bandgap reference voltage is used as input to the ADC, it will take a certain time for the voltage to stabilize. If not stabilized, the first value read after the first conversion may be wrong.

So if you are doing multiple reads, you need to wait a few cycles.

Delays are not required when using auto-triggering:

When Auto Triggering is used, the prescaler is reset when the trigger event occurs. This assures a fixed delay from the trigger event to the start of conversion. In this mode, the sample-and-hold takes place two ADC clock cycles after the rising edge on the trigger source signal. Three additional CPU clock cycles are used for synchronization logic.

Also if reading different channels of the same ADC module, you need to provide a delay between the reads so that the analog MUX is positioned and the S&H capacitor is charged.

This information is from hardware perspective and I'm not sure if Arduino internal ADC routines compensate for those delays.

Digital Stability

From the digital read tutorial schmatic:

enter image description here

In the schematic, the push button is not electrically de-bounced. A delay in reading states would help de-bounce it in software.

As Nick Gammon suggested, they also improve serial flooding.

From the Datasheet of ATMEGA328 Page 240:

When the bandgap reference voltage is used as input to the ADC, it will take a certain time for the voltage to stabilize. If not stabilized, the first value read after the first conversion may be wrong.

So if you are doing multiple reads, you need to wait a few cycles.

Delays are not required when using auto-triggering:

When Auto Triggering is used, the prescaler is reset when the trigger event occurs. This assures a fixed delay from the trigger event to the start of conversion. In this mode, the sample-and-hold takes place two ADC clock cycles after the rising edge on the trigger source signal. Three additional CPU clock cycles are used for synchronization logic.

Also if reading different channels of the same ADC module, you need to provide a delay between the reads so that the analog MUX is positioned and the S&H capacitor is charged.

This information is from hardware perspective and I'm not sure if Arduino internal ADC routines compensate for those delays.

As Nick Gammon suggested, they also improve serial flooding.

Analog Stability

From the Datasheet of ATMEGA328 Page 240:

When the bandgap reference voltage is used as input to the ADC, it will take a certain time for the voltage to stabilize. If not stabilized, the first value read after the first conversion may be wrong.

So if you are doing multiple reads, you need to wait a few cycles.

Delays are not required when using auto-triggering:

When Auto Triggering is used, the prescaler is reset when the trigger event occurs. This assures a fixed delay from the trigger event to the start of conversion. In this mode, the sample-and-hold takes place two ADC clock cycles after the rising edge on the trigger source signal. Three additional CPU clock cycles are used for synchronization logic.

Also if reading different channels of the same ADC module, you need to provide a delay between the reads so that the analog MUX is positioned and the S&H capacitor is charged.

This information is from hardware perspective and I'm not sure if Arduino internal ADC routines compensate for those delays.

Digital Stability

From the digital read tutorial schmatic:

enter image description here

In the schematic, the push button is not electrically de-bounced. A delay in reading states would help de-bounce it in software.

As Nick Gammon suggested, they also improve serial flooding.

Source Link

From the Datasheet of ATMEGA328 Page 240:

When the bandgap reference voltage is used as input to the ADC, it will take a certain time for the voltage to stabilize. If not stabilized, the first value read after the first conversion may be wrong.

So if you are doing multiple reads, you need to wait a few cycles.

Delays are not required when using auto-triggering:

When Auto Triggering is used, the prescaler is reset when the trigger event occurs. This assures a fixed delay from the trigger event to the start of conversion. In this mode, the sample-and-hold takes place two ADC clock cycles after the rising edge on the trigger source signal. Three additional CPU clock cycles are used for synchronization logic.

Also if reading different channels of the same ADC module, you need to provide a delay between the reads so that the analog MUX is positioned and the S&H capacitor is charged.

This information is from hardware perspective and I'm not sure if Arduino internal ADC routines compensate for those delays.

As Nick Gammon suggested, they also improve serial flooding.