Need help for programming Digital potentiometer AD5122A in I2C mode. The documentation of Analog Devices on steps and sequence of programming for reading the RDAC or Control registers is not clear. Also, there is confusion about the naming convention of the registers viz Serial register, Input shift register etc. Request clarification on this matter. An application note on programming would have helped. Regards
for(i = 0; i < 8; i++) // Send 8 bits to the I2C Bus
bSCL_AD5122 = LOW; // MOST CRITICAL !!!!!!!!!!!!!
bSDA_AD5122 = ((ucWriteByte & 0x80) ? 1 : 0); // Output the data bit to the I2C Bus
ucWriteByte <<= 1; // Shift the byte by one bit
bSCL_AD5122 = HIGH; // Clock the data into the I2C Bus
bSCL_AD5122 = LOW;
bSDA_AD5122 = HIGH; // Pull up this port to make it reading port
bByteACKStatus = bSDA_AD5122;// MCP-79410 acknowledges the receipt of the byte by LOW signal. HIGH indicates data not received.
bSCL_AD5122 = LOW; // for receiving the ACK bit from the MCP-79410 after each byte of transfer
bSCL_AD5122 = HIGH;