I am trying to use ADS1115 as a moderately high speed ADC directly from my (Windows 11) desktop through FT232H. Using this setup, when changing the sampling rate from the default to the highest possible rate (860 samples/second) the actual number of samples/second is stuck at around 32/sec. Oddly enough when testing I found that setting the ADC to 64/sec actually gives me the highest actual rate (around 45-50/sec) for some reason that is completely unknown to me.
I have tried many different things, including changing the frequency of my i2c connection, and decreasing the sleep period in pyftdi under the read function in protocol_ftdi.py. I found some references to this issue online, but nothing specific to my situation. I found one using very outdated software, and another that claims a similar issue was resolved .
Note that when I use a FeatherS3 board to connect with the ADC, I am able to roughly achieve the expected sampling rate, however with the feather board I can't run the code through python on my PC (as far as I am aware). Note that I connected the two boards directly together with a StemmaQT cable. I have put the code I am using below, and timing the for loop gives me my samples per second.
Any help is appreciated, and let me know if any other information would be helpful.
Thanks you!!
Code: Select all
import board
import busio
import adafruit_ads1x15.ads1115 as ADS
from adafruit_ads1x15.analog_in import AnalogIn
i2c = busio.I2C(board.SCL, board.SDA, frequency=100000)
ads = ADS.ADS1115(i2c)
chan = AnalogIn(ads, ADS.P0)
ads.mode = ADS.Mode.CONTINUOUS
ads.data_rate = 860
_ = chan.value
data = []
for i in range(860):
data.append(chan.voltage)