Below are the macro definitions in the source code in main.c
file listed.
#define HARMONIC_NOISE 1
1
: Generate PWM signal as a periodic
noise.
0
: Do not generate PWM signal.
#define PWM_FRQ 62000
Configuration of PWM frequency, 62 kHz.
To get the worst-case scenario of periodic noise in the test setup, the PWM frequency can be selected close to ADC sampling frequency.
#define ADC_64X_ACCUMULATOR_ENABLE 1
Enable configuration of consecutive sample accumulation.
1
: 64 consecutive sample
accumulation.
0
: No multiple sample accumulation
(only one ADC sample accumulation).
Note that this example shows a result graph with the ADC sample accumulation of 1 sample or 64 samples by using only the ADC_64X_ACCUMULATOR_ENABLE macro.
The Microchip tinyAVR® 1-series and megaAVR® 0-series support sample accumulation of 1, 2, 4, 8, 16, 32, and 64. For sample accumulation other than 1 or 64, the code needs to be changed accordingly.
#define SAMPLING_DELAY 5
0
: No sampling delay between
consecutive samples in one single burst.
1 to 15: Configures the sampling delay between consecutive samples in one single burst. The delay is expressed as CLK_ADC cycles, 1 being a delay of one cycle.
#define ENABLE_ASDV 0
1
: Enable the automatic sampling
delay between consecutive samples in one single burst.
0
: Do not enable automatic sampling
delay variation.