Does readSynchronizedContinuous() require calling isComplete() first to check if data conversion is done?

clappertown

New member
In ADC library example: synchronizedMeasurements.ino

In void loop() {

// You can also try:
// result = adc->analogSynchronizedRead(readPin, readPin2);
// result = adc->analogSynchronizedReadDifferential(A10, A11, A12, A13);

result = adc->readSynchronizedContinuous();
// if using 16 bits and single-ended is necessary to typecast to unsigned,
// otherwise values larger than 3.3/2 will be interpreted as negative
result.result_adc0 = (uint16_t)result.result_adc0;
result.result_adc1 = (uint16_t)result.result_adc1;
...}

Should I add while (!adc->adc0->isComplete() || !adc->adc1->isComplete()); before result = adc->readSynchronizedContinuous() ? I noticed adding isComplete() will slow down the sampling rate by almost 15x on T4.1, but not sure if it's needed.
 
In ADC_Module.h, it seems it only reads adc register and doesn't do sanity check.


int analogReadContinuous() __attribute__((always_inline)) {
#ifdef ADC_TEENSY_4
return (int16_t)(int32_t)adc_regs.R0;
#else
return (int16_t)(int32_t)adc_regs.RA;
#endif
}
 
Back
Top