The only way you will achieve anything like 66 MHz is with a custom PCB, using short tightly-controlled tracks between the CPU and ADC. A more sensible maximum is probably around 20 MHz, but this will depend on the way you've wired up the ADC.
I suspect the slowness comes from SPI beginTransaction and endTransaction; can't you start the transaction and keep it open, then toggle the CS (using direct-register writes, for speed), do the read cycle, then another CS toggle, another read, and so on?
The SPI reads could also be done as direct-register accesses, and also your code could benefit from minor optimisation; for example, why are you setting the adcRead variable to zero, then doing an 'or' with the transBuff value, when you could just set the variable to that value?
Finally, there is the question of the compiler settings; I haven't used the Arduino IDE, but with the usual development method you can get a major improvement in speed by using the compiler optimisation flags (e.g. -O2 in 'release' vs. 'debug' mode).
I suspect the slowness comes from SPI beginTransaction and endTransaction; can't you start the transaction and keep it open, then toggle the CS (using direct-register writes, for speed), do the read cycle, then another CS toggle, another read, and so on?
The SPI reads could also be done as direct-register accesses, and also your code could benefit from minor optimisation; for example, why are you setting the adcRead variable to zero, then doing an 'or' with the transBuff value, when you could just set the variable to that value?
Finally, there is the question of the compiler settings; I haven't used the Arduino IDE, but with the usual development method you can get a major improvement in speed by using the compiler optimisation flags (e.g. -O2 in 'release' vs. 'debug' mode).
Statistics: Posted by jayben — Sat Apr 06, 2024 8:36 am