I have made measurements with the built-in ADC. When I displayed the data graphically, I noticed that certain values are missing or are displayed as "0". Interestingly these values are in the binary-typical distance of 64 to 65. Possibly it is a quantization problem. The following measured values are missing:
318 + 319
382 + 383
446 + 447
510 + 511
575
639
I have run measurements for some time, and summed up the measurement results. Normally the measured values are between 0 and 1024 (2^10) for a 10 bit measurement. I have now counted how often certain measured values were measured.
for example the measurement value 637 was measured 7679 times. The measurement value 638 was measured 599 times (which is also unusual), the measurement value 639 was not measured at all, while the next measurement value 640 was measured 7483 times. This is purely from the measurement technology not possible that there could be dropouts here. I assume that a certain bit in the converter does not work. Now I used another input pin and it is the same values that do not exist.
These were measurements, on my project. In the meantime, I put a noise generator on the analog input pin, and observed the noise. In fact, I see white lines in the graphical representation.
Then, because I wanted to rule out that it was due to serial reception, I caused an output of the values I mentioned earlier.
In fact, these values are not output, but the ones right next to them are output. I made this last test with the attached program.
On the attached screenshot you can clearly see the horizontal lines in the noise
318 + 319
382 + 383
446 + 447
510 + 511
575
639
I have run measurements for some time, and summed up the measurement results. Normally the measured values are between 0 and 1024 (2^10) for a 10 bit measurement. I have now counted how often certain measured values were measured.
for example the measurement value 637 was measured 7679 times. The measurement value 638 was measured 599 times (which is also unusual), the measurement value 639 was not measured at all, while the next measurement value 640 was measured 7483 times. This is purely from the measurement technology not possible that there could be dropouts here. I assume that a certain bit in the converter does not work. Now I used another input pin and it is the same values that do not exist.
These were measurements, on my project. In the meantime, I put a noise generator on the analog input pin, and observed the noise. In fact, I see white lines in the graphical representation.
Then, because I wanted to rule out that it was due to serial reception, I caused an output of the values I mentioned earlier.
In fact, these values are not output, but the ones right next to them are output. I made this last test with the attached program.
On the attached screenshot you can clearly see the horizontal lines in the noise
Code:
#include "TeensyTimerTool.h"
#include <ADC.h>
ADC *adc;
using namespace TeensyTimerTool;
int Val_u = 0;
void setup() {
//Serial.begin(115200);
Serial.begin(230400);
// Serial.begin(38400);
adc = new ADC();
analogReadAveraging(1);
// Methode 2
adc->adc0->setReference(ADC_REFERENCE::REF_3V3); // internal 3.3V ref
adc->adc0->setAveraging(1); // samples per reading
adc->adc0->setResolution(10); // bits of resolution
adc->adc0->setConversionSpeed(ADC_CONVERSION_SPEED::HIGH_SPEED);
adc->adc0->setSamplingSpeed(ADC_SAMPLING_SPEED::MED_SPEED);
}
void loop() { // Whole array send to SerialPort
// read;
Val_u = adc->adc0->analogRead(A17);
if (Val_u == 319 || Val_u == 320 || Val_u == 446 || Val_u == 447 || Val_u == 448 || Val_u == 510 || Val_u == 511 || Val_u == 512) {
Serial.println(Val_u);
}
}