Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3847

General • Re: External ADC via SPI speed on Pi pico

$
0
0
I would start removing one part of the software after the other and measure time needed.
- comment out the CS digitalWrite (although it is needed at the end, just get the time budget)
- comment SPI.beginTransaction, endTransaction(), which is "Initializes the SPI bus" according to the docs, Guess it is needed only once; not in the loop
- comment out the SPI part, just to see what the time budget of this operation is.
- remove the times\[i\] = micros()-startMicros; and measure time from start to end.

side topic: the uint32_t adcRead is a uint32_t, but the mthod returns only uint16_t
side topic: 60MHz clock frequency on a breadboard is perhaps a bit optimistic. Check the signals with an oscilloscope and eventually reduce till waveform is clear.

Statistics: Posted by ghp — Fri Apr 05, 2024 10:27 pm



Viewing all articles
Browse latest Browse all 3847

Trending Articles