0

ADS1X15 continuous mode
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

ADS1X15 continuous mode

by Jtknep on Fri May 28, 2021 1:27 pm

I’m successfully using the Adafruit_ADS1X15 library written by Kevin Townsend. The ADS1015 is connected to an ESP32 development board. Can anyone tell me how to put the device into continuous mode? It might help me to measure short duration pulse amplitudes.
Separately, in case the author is interested in minor corrections, the documentation says the default sample rate is 1600 sps but mine is reporting 128 sps in the single shot mode.
Thanks for reading.

Jtknep
 
Posts: 2
Joined: Fri May 28, 2021 1:02 pm

Re: ADS1X15 continuous mode

by adafruit_support_mike on Sun May 30, 2021 5:24 pm

The library doesn't support continuous mode, but you can add it. Follow the same process used in the function .readADC_SingleEnded(), but use th constant ADS1X15_REG_CONFIG_MODE_CONTIN instead of ADS1X15_REG_CONFIG_MODE_SINGLE in the configuration:

https://github.com/adafruit/Adafruit_AD ... #L119-L124

Then loop around the section that waits for the conversion to be done before reading a value:

https://github.com/adafruit/Adafruit_AD ... #L154-L159

adafruit_support_mike
 
Posts: 63053
Joined: Thu Feb 11, 2010 2:51 pm

Re: ADS1X15 continuous mode

by Jtknep on Mon May 31, 2021 1:05 pm

Thanks for the prompt reply! Not surprisingly, I’m still having problems. I’m new to this. When you say “loop around the section” do you mean for me to comment out those two lines of code? Also, is there a need to change this line: config |= ADS1X15_REG_CONFIG_OS_SINGLE; ?

Jtknep
 
Posts: 2
Joined: Fri May 28, 2021 1:02 pm

Re: ADS1X15 continuous mode

by adafruit_support_mike on Mon May 31, 2021 7:25 pm

If the ADC is operating in continuous mode, it makes sense to capture readings as soon as they're available. As soon as you get a reading, you jump back to watching conversionComplete() until the next reading is ready.

adafruit_support_mike
 
Posts: 63053
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.