I was reading some values from a function generator using the MCP3008 ADC, however, I got 5 times as many samples with the spi device library than I did with Adafruit's MCP3008. Why is that the case? It seems that because Adafruit's library is specific to MCP3008, it should be faster, but is not.
Asked
Active
Viewed 188 times
1 Answers
3
The SPI library uses the SPI hardware.
I suspect the Adafruit code was written before the SPI library was written and uses a technique called bit banging to access the MCP3008. Bit banging will be much slower than using the SPI hardware.
joan
- 71,014
- 5
- 73
- 106
-
adafruit/Adafruit_Python_MCP3008 uses hardware SPI if it's available. – scruss Aug 04 '17 at 16:35