0

In the datasheet, the maximum clock frequency (when the ADC is powered with maximum voltage of 5V) is 3.6 MHz. Each read takes about 24 clock cycles which gives us a maximum sampling rate of about 150 KSPS. However, I have a couple of questions:

1) Why is it that the ADC is advertised to be a 200 ksps ADC when the theoretical maximum is about 150 KSPS?

2) Is the calculation that I have done correct?

Thank you!

1 Answers1

1

You have made the assumption that 24 clocks are required. A quick look at the datasheet suggests 18 clocks are required per cycle. This gives a figure of 3600000 / 18 = 200000

The faulty assumption is that all devices require transfers in multiples of 8 bits.

joan
  • 71,014
  • 5
  • 73
  • 106
  • Huh, interesting. But why is it then that when I use the following code: https://raspberrypi.stackexchange.com/questions/70314/how-to-have-python-use-more-of-my-cpu (I have actually modified it to store whatever reading I get in a list and then after the entire conversion, transfer all the data to a file, instead of writing to the file every time I read a value), powering the ADC with 5V, setting it to a max frequency of 3.6 MHz, I cannot achieve a sampling rate higher than about 41 KSPS? – Always Learning Forever Aug 04 '17 at 06:05
  • That code uses the Raspberry Pi Linux SPI driver which uses the Raspberry Pi hardware SPI peripheral which transfers bits in multiples of 8-bit bytes. I'm a little surprised you can reach 41 KSPS with Python. Was that a Pi3? – joan Aug 04 '17 at 08:00
  • I don't get it, why will it limit my ability to reach the sampling rate of, say, 150KSPS? Will switching to C help? Yes it was. – Always Learning Forever Aug 04 '17 at 08:06
  • Python is an interpreted language and some applications will be slower than those implemented in a compiled language such as C. See C SPI speed. – joan Aug 04 '17 at 08:12
  • Gotch ya, thank you so much! One more question: can I plugin more than one ADC into the Pi? I have successfully plugged in to in the CE0 and the CE1 pins and they work all right, however, I want to add more. – Always Learning Forever Aug 04 '17 at 08:19
  • The Linux SPI driver allows arbitrary GPIO to be used as slave selects, see /boot/overlays/README or you can just toggle the GPIO slave selects yourself (i.e. bit bang the chip selects) for a small performance penalty. – joan Aug 04 '17 at 08:24
  • I looked at the file, however, I cannot change it or anything. And I don't get much of what's happening there, how do I change the file (or maybe some other) to enable a GPIO pin to act as a CE pin? – Always Learning Forever Aug 07 '17 at 20:11
  • https://www.raspberrypi.org/forums/viewtopic.php?t=157994&p=1028222 I found this, however, it expands from 2 CE pins to 4. What if I want to have more than 4 CE pins? Thank you! – Always Learning Forever Aug 07 '17 at 20:18