Traducido del English por IA ·
«cmd» es la nomenclatura de SMBus. En una escritura de bloque SMBus, el primer byte después de la dirección se llama byte de comando, y en chips basados en registros como el ADS1115 ese byte es el puntero de registro. Así que tu primera línea coloca el puntero en el registro Config (0x01) y escribe en él 0xC3 y luego 0x83. En el bus: start, 0x90, 0x01, 0xC3, 0x83, stop.0xC383 significa: iniciar una conversión única, AIN0 respecto a GND, rango de ±4,096 V, modo single-shot, 128 muestras/s. La lectura pone el puntero en 0x00 (registro de conversión) y lee dos bytes.Tu error está en el orden de los bytes. El ADS1115 envía primero el byte más significativo, y el resultado es con signo:
data = bus.read_i2c_block_data(0x48, 0x00, 2)
raw = (data[0] << 8) | data[1]
if raw > 0x7FFF:
raw -= 0x10000
volts = raw * 4.096 / 32768
Con los bytes intercambiados, un pequeño cambio en el byte bajo se convierte en un salto enorme, que es tu 900 frente a 52.000. Para AIN1 cambia los bits MUX: [0xD3, 0x83]. Y 10 ms son suficientes a 128 SPS (una conversión dura unos 8 ms), así que la pausa está bien.
«cmd» is SMBus naming. In an SMBus block write the first byte after the address is called the command byte, and for register-based chips like the ADS1115 that byte is the register pointer. So your first line puts the pointer on the Config register (0x01) and writes 0xC3 then 0x83 into it. On the wire: start, 0x90, 0x01, 0xC3, 0x83, stop.
0xC383 means: start a single conversion, AIN0 against GND, ±4.096 V range, single-shot mode, 128 samples/s. The read sets the pointer to 0x00 (Conversion register) and reads two bytes.
Your bug is the byte order. The ADS1115 sends the most significant byte first, and the result is signed:
data = bus.read_i2c_block_data(0x48, 0x00, 2)
raw = (data[0] << 8) | data[1]
if raw > 0x7FFF:
raw -= 0x10000
volts = raw * 4.096 / 32768
With the bytes swapped, a small change in the low byte becomes a huge jump, which is your 900 vs 52,000. For AIN1 change the MUX bits: [0xD3, 0x83]. And 10 ms is enough at 128 SPS (one conversion is about 8 ms), so the sleep is fine.

