I2C ADC converter speed, possible to speed up?

Hi, I'm working on a datalogger for Tractor-pulling and want to measure pressures from sensors around the engine. I have incorporated two ADS7828 12-bit I2C ADC converters, using 400KHz.

Reading one device on all eight(8) channels takes 1008uS, while in 3.4MHz mode I can get it down to 430us. Whilst in the datasheet it states one conversion should take 6uS (6*8=48uS?), am I misunderstanding something, or is there something else going on?

ADS7828 Datasheet

Test code:

/**************************************************************************/
/*
        Distributed with a free-will license.
        Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
        ADS7828
        This code is designed to work with the ADS7828_I2CADC I2C Mini Module available from ControlEverything.com.
        https://www.controleverything.com/content/Analog-Digital-Converters?sku=ADS7828_I2CADC#tabs-0-product_tabset-2
        NT
*/
/**************************************************************************/

#include <i2c_adc_ads7828.h>

// device 0
// Address: A1=0, A0=1
// Command: SD=1, PD1=1, PD0=1
ADS7828 device1(0, SINGLE_ENDED | REFERENCE_ON | ADC_ON, 0xFF);

unsigned long currentMicros, currentMillis;
long previousMicros, previousMillis, loopTime;
long interval = 250;
int adc0, adc1, adc2, adc3, adc4, adc5, adc6, adc7;

void setup(void) 
{
    Serial.begin(115200);

    ADS7828::begin();
    //Wire.setClock(400000L);
    Wire.setClock(3400000L);
}

void loop(void){
    currentMicros = micros();
    currentMillis = millis();
    if(currentMicros >= previousMicros) {
    loopTime = (currentMicros - previousMicros);
    previousMicros = currentMicros;
  }
  
  // update all registered ADS7828 devices/unmasked channels
  ADS7828::updateAll();
  
  adc0 = (ADS7828::device(0)->channel(0)->value());
  adc1 = (ADS7828::device(0)->channel(1)->value());
  adc2 = (ADS7828::device(0)->channel(2)->value());
  adc3 = (ADS7828::device(0)->channel(3)->value());
  adc4 = (ADS7828::device(0)->channel(4)->value());
  adc5 = (ADS7828::device(0)->channel(5)->value());
  adc6 = (ADS7828::device(0)->channel(6)->value());
  adc7 = (ADS7828::device(0)->channel(7)->value());

  if(currentMillis - previousMillis > interval) {
    Serial.print("Loop Time: ");
    Serial.print(loopTime);
    Serial.println(" uS ( 1000uS=1mS 1S=1000mS )");
    Serial.println("Getting single-ended readings from AIN0..7");
    Serial.print("Digital Value of Analog Input at Channel 0: ");
    Serial.println(adc0);
    Serial.print("Digital Value of Analog Input at Channel 1: ");
    Serial.println(adc1);
    Serial.print("Digital Value of Analog Input at Channel 2: ");
    Serial.println(adc2);
    Serial.print("Digital Value of Analog Input at Channel 3: ");
    Serial.println(adc3);
    Serial.print("Digital Value of Analog Input at Channel 4: ");
    Serial.println(adc4);
    Serial.print("Digital Value of Analog Input at Channel 5: ");
    Serial.println(adc5);
    Serial.print("Digital Value of Analog Input at Channel 6: ");
    Serial.println(adc6);
    Serial.print("Digital Value of Analog Input at Channel 7: ");
    Serial.println(adc7);
    Serial.println("        ****************************************        ");
    Serial.println(" ");
    previousMillis = currentMillis;
  }
}

Serial monitor:

Loop Time: 430 uS ( 1000uS=1mS 1S=1000mS )
Getting single-ended readings from AIN0..7
Digital Value of Analog Input at Channel 0: 1434
Digital Value of Analog Input at Channel 1: 2172
Digital Value of Analog Input at Channel 2: 2446
Digital Value of Analog Input at Channel 3: 2585
Digital Value of Analog Input at Channel 4: 2513
Digital Value of Analog Input at Channel 5: 2704
Digital Value of Analog Input at Channel 6: 2089
Digital Value of Analog Input at Channel 7: 29
        ****************************************

*Edit, I'm using Teensy 4.1 @ 600MHz for these tests btw...

Using assembly language?

The code you have posted does not give that output on the serial monitor. Here is a clue

void loop(void){
    currentMicros = micros();
    currentMillis = millis();
    if(currentMicros >= previousMicros) {
    loopTime = (currentMicros - previousMicros);
    previousMicros = currentMicros;
  }

The data sheet states the conversion time only. It does not take into account the time for switching the input multiplexer nor the data acquisition time for the input sample and hold circuit. So you can't just multiply one conversion rate by eight.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.