Hey there,
i have a setup using a teensy 4.0, a CD74HC4067 and 10 pots connected to it.
In my readout loop i have a delayMicroseconds() to allow the mux to settle after changing the channel:
for (uint8_t channel = 0; channel < 10; channel++)
{
mp.setChannel(channel);
delayMicroseconds(80);
Serial.print(String(analogRead(A1)) + "\t");
}
Now, sometimes this works as expected, going as low as 50-60 us to get reliable results. But then, sometimes, when using a similar loop within a bigger project, my readings explode: each potentiometer seems to affect the one on the next channel, and to a lesser degree the ones following after that. This behavious gets less the higher I make the settling delay, but only gets usable when it's >1000us, which is way too much for my application.
The weird thing here is, that sometimes, in a clean new debugging project with just the readout loop, it runs fine at 60us. But then once it somehow goes into "slow" mode, it shows the same erratic behaviour even when i upload the clean debug project.
Did anybody ever experience something similar or has any explanation for it?
The hardware is soldered up on a perf board, pretty permanent. And since it sometimes works perfect, and sometimes when i just up the "settle" time, i think i can eliminate connection issues here.
Edit: I am not using the EN pin, but i doubt that will help? Again, sometimes, it seems to work perfectly fine. Also, I did try another CD74HC4067, same behaviour. It is cheap amazon shields though.