I have encountered problems (corrupted data) trying to use the audio pipeline setup with an ADC1 source,
AudioInputAnalog adc1; // ADC1
concurrently with reading a resistive touchscreen axis with,
value1 = analogRead(A12); //ADC2
and am wondering if running both Teensy 4.1 ADCs concurrently is a known problem (although a multitude of searches implies it should work).
Things that I know:
...JimC
AudioInputAnalog adc1; // ADC1
concurrently with reading a resistive touchscreen axis with,
value1 = analogRead(A12); //ADC2
and am wondering if running both Teensy 4.1 ADCs concurrently is a known problem (although a multitude of searches implies it should work).
Things that I know:
- If I comment out calls to analogRead(A12) the audio pipeline works as expected (no audio data corruption)
- If I modify analog.c (illustrated below) to not start ADC2 then the audio pipeline works as expected:
- if (!(ch & 0x80)) {
ADC1_HC0 = ch;
while (!(ADC1_HS & ADC_HS_COCO0)) {
yield(); // TODO: what happens if yield-called code uses analogRead()
}
return ADC1_R0;
} else {
return 0; // Don't start ADC2
ADC2_HC0 = ch & 0x7f;
while (!(ADC2_HS & ADC_HS_COCO0)) {
yield(); // TODO: what happens if yield-called code uses analogRead()
}
return ADC2_R0;
}
- if (!(ch & 0x80)) {
...JimC