Post Go back to editing

Unable to get desired resistance in AD5122A

Thread Summary

The user encountered an issue with the AD5122A digital potentiometer, where setting the wiper to the maximum value (0x7F) resulted in a resistance of 0.9 kOhm instead of 100 kOhm. The final answer suggests that the AD5122A ignores the least significant bit of the 8-bit I2C write, so the value 0x7F is interpreted as 0x3F (63). To achieve the maximum resistance, the user should write 0xFE to the RDAC register. The user confirmed that the RDAC1 register read back as 0x7E instead of 0x7F, supporting this hypothesis.
AI Generated Content

Hello all,

I'm working AD5122a and set the wiper to maximum (0x7f) and tested resistance between w1 and b1 terminals of AD5122A then i got 0.9 Kilo ohm instead of 100 kilo ohm.

My code: 

i2c_write(0xd0, 0x09);                          // set control register of potentiometer mode, i2c burst mode

i2c_write(0x90, 0x80);                         // set to normal mode

i2c_write(0xc0, 0x00);                        // set to normal mode

i2c_write(0x10, 0x7f);                       // set rdac register with highest value.

AD5122A  -- AD5122ABCPZ100-RL7 

R A,B  ---100 Kilo ohm
Resolution --- 128
Interface --- I2C

Please guide me where I'm doing mistake.

Thanks,

Ashok.

Parents Reply Children
  • Hello vsethia,

    Thank you for quick reply. 

    Did you read back the RDAC1 register to confirm whether the RDAC1 register is updated with 0x7F.?

    Yes, I read rdac1 register by sending command

    i2c_write(0x30, 0x03);                                // set to address of rdac1 with read command

    but i got 0x7e instead of 0x7f. I verified this in debug mode.

    And also changed rdac1 register 0x40 and read the contents of rdac is 64. So, i can able write and read RDAC1 register. 

    Are the resistor terminals connected to any signals ? 

    Terminals of w1 and b1 is connected to OP-Amp of "OPA2320AID" pin numbers between 1 and  2. as feedback resistance of op-amp.

    I tested the resistance between those pins (pin 1 and 2) of OPA2320AID but i got 0.9 kilo ohm.

    Please guide me,

    Thanks,

    Ashok.

  • Did you figure this out?

    I have a suspicion that when using the AD5122A, when you write 8 bits to the RDAC register via I2C, the chip ignores the least significant bit. Notice how when you read from the register, the least significant bit you wrote got changed from 1 to 0.  I think that the 7-bit RDAC register that the datasheet sometimes refers to captures the 7 most significant bits from the I2C write. If you think of the range of that register as 0 to 0x7F, then you have to shift the data value left by 1 before writing it via an I2C cycle.  

    I suspect that when you wrote 0x7F via I2C, the chip interpreted that as 0x3F (63). Using equation 3 from the data sheet: Raw = (128-63)/128 x 100k = ~50 KOhm.  I don't know how you go 0.9 kOhm on Rwb. Try writing an 0xFE to the RDAC register and see if that gets your Rwb closer to 100 KOhm.

  • Hello! Thanks for the helpful hint  !

    I just came across this thread while investigating the exact same issue myself. With your help, I managed to find the exact problem and resolve it.

    You can find a full description of the issue and my solution in a github issue here. I will also update that thread with an updated branch in the coming days!

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.