Per the topic, I’m trying to send a 4-byte I2C command in master mode to a TI DAC43608. For reasons unbeknownst, the code appears to be writing the first byte only.
The loop() section iterates at 1Hz and things seem to indicate the write() calls are buffering data. Oddly as well, the endTransmission() call returns a code 3 (end of address transmission timeout).
And for other background, v0.6.3 Dev OS on a Photon, and I have called Wire.begin() in setup(). The variable output_ADC is uint_8 type that’s incremented by 1 for each loop() iteration.
I know I’m overlooking something but stumped as to what it might be? I’ve got production SPI interfaces run at scale, but this is my first stab @ I2C.
Thanks in advance for any advice.
Here’s the master broadcast code snippet:
// DAC address (A0 = AGND) Table 3 Wire.beginTransmission(0x50); // COMMAND Byte (DACA_DATA) Table 4 Serial.printlnf("Command = %d", Wire.write(0x08)); // HI ADC data nibble in low nibble (left aligned MSB) Serial.printlnf("Hi Data = %d", Wire.write((uint8_t)(output_ADC & 0xF0) >> 4)); // LO ADC data nibble in high nibble (left aligned MSB) Serial.printlnf("Lo Data = %d", Wire.write((uint8_t)(output_ADC & 0x0F) << 4)); Serial.printlnf("End TX = %d", Wire.endTransmission(TRUE));
Here’s a snip from the serial debug stream output
Command = 1
Hi Data = 1
Lo Data = 1
End TX = 3
ADC output level = 84 / MSDB = 5 / LSDB = 40
Lastly, here’s the SDA/SCL line capture: