AD5272 accessing and programming issues

Hi,

I am trying to access AD5272 I2C programmable resistor but have communication issues. I found that, comparing to AD5259 datasheet, the datasheet of the AD5272 is quite unusable, unreadable and even with the wrong data containing. Unfortunately, no software samples are provided.

The chip itself is connected to an Arduino-like board to I2C pins. The address of AD5272 is 0x2C and the chip is visible on I2C bus.

If I understood correctly, the chip should have disabled RDAC write-protect (thus, I should write 0b10 to the Control register).

After that step, I have tried to write the random value to the RDAC.

The next step is to read back the RDAC value, just for checking.

But, I am missing some points obviously, because I can read back the same value, or it seems that I can't even write to RDAC. Unfortunately, I have no evaluation board available thus no having opportunity to sniff some valid data on the bus.

Here is my code, hope it is well explained so you will be able to give me some suggestions.

Regards,

s.micic

//Unlocking *******************************************************************************

Wire.beginTransmission(0x2C); // transmit to device with address 0x2C
Wire.write(0b00011100); // Write contents of the serial register data to the control register.
Wire.write(0b00000010); // sends instruction byte for unlocking
Wire.endTransmission(); // stop transmitting



//Writing to RDAC procedure *******************************************************************************
Wire.beginTransmission(0x2C); // transmit to device 0x2C
Wire.write(0b00000100); //Write contents of serial register data to RDAC. 
Wire.write(0b0000111); // write 7 to RDAC (random number) 
Wire.endTransmission(); // stop transmitting


delay(1000);

//Reading from RDAC procedure ***************************************************************************

Wire.beginTransmission(0x2C); // transmit to device 0x2C
Wire.write (0b00001000); // sends instruction byte for RDAC reading 
Wire.write (0b00000000); //doesn't care actually
Wire.endTransmission(); // stop transmitting
delay(300);



//Picking up the response, containing 2 bytes RDAC readback*********************************

Wire.requestFrom (0x2c, 2); 
if(Wire.available() == 2){ 
c = Wire.read (); // receive a byte as character 
Serial.print ("RDAC ="); // print the character 
Serial.print (c); // print the character 
Serial.println (" "); 
}



//Requesting control register content***************************************************
Wire.beginTransmission(0x2C); // transmit to device 0x2C
Wire.write (0b0100000); // sends instruction byte for reading 
Wire.write (0b00000000); //doesn't care
Wire.endTransmission(); // stop transmitting

Wire.requestFrom (0x2c, 2); 

if(Wire.available() == 2){ 
val = Wire.read (); // receive a byte as character 
Serial.println (" "); 
Serial.print ("Register ="); // print the character 
Serial.print (val); // print the character 
Serial.println (" "); 
}

Top Replies

  • 0
    •  Analog Employees 
    on Sep 10, 2020 5:29 AM

    You can buy the Eval board for AD5272 to test the part. The link is https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EVAL-AD5272.html

    Additionally, the linux drivers are available at the link https://wiki.analog.com/resources/tools-software/linux-drivers/misc/dpot

    Can you tell us, what is wrong in the AD5272 datasheet.

    I2C read and write commands are clearly mentioned in the datasheet on Pages 19 and 20. 

    Additionally, please share the schematic.

  • The datasheet contains a table that is not appropriate for the device described so it just confuses the reader unnecessary.

    Schematic is the most simple, Seeduino XIAO board connected directly to the AD5272, with ADDR pin tied to Vdd, so the I2C address is b101100. Pull-ups are 10k. I am testing every day a lot of devices on the same protoboard and no communication issues have been found for now.

    I would say that this is just a programming issue that I can't resolve without confirming that I do the programming job well or not.

    Can you comment/confirm the code I have attached?

    For now, I am just trying to write data to control register and read it back but I get only zeroes as an answer...

    A sample of code at the end of the datasheet  would be very useful, I guess...

    Regards,

    s.micic

  • 0
    •  Analog Employees 
    on Sep 10, 2020 9:23 AM in reply to s.micic

    Can you tell which table has the issues in the datasheet.?

    I am not familiar with the Seeduino board and its codings. However, your codes seem to be correct with respect to the I2C read and write commands to AD5272. Only missing in the code is to enable the update of wiper position.

    An example command list is provided in Table 13.

    You have not yet shared the schematic.

  • Here is the schematic. Vdd and RST are tied to 5V but that Is not visible here.

    Consider that I am working with Arduino.

    Thank you for confirming that the code is the one that should work.

    You said that I am missing the part of code that should enable the update of wiper position. I thought that the first part of my code is supposed to do that!?!? (//Unlocking ******).

    The table 13 you are referring to, describes SPI interface/commands and this device is only I2C capable, so, the mentioned table is absolutely unnecessary in this datasheet.

    Cheers

  • 0
    •  Analog Employees 
    on Sep 11, 2020 4:26 AM in reply to s.micic

    My apologies. I somehow missed reading the first code section. Thanks for bringing it to my notice.

    Table 13 shows the shift register contents as per Figure 2 that will be used to parsed into SDA data in I2C transactions. So, there is nothing wrong with the Table 13.

    What is VDD connected to? Is it same as 5V supply. 

    You need to confirm if the Arduino uC digital interface is 5V compatible. Also, have you confirmed if the SDA data during read back is correct.