lpcware

Programming of Digital potention meter(AD5252)

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by shiggy on Fri Oct 18 04:16:18 MST 2013
Hi Everyone!

I have making the I2C for to write and read RADC reg of AD5252 chip of Analog devices.
Reading data is not in agreement with write-in data.
Is this probrem of my software or a kind of failure of AD5252.
I think that there is very little probability of failure with hard, in my experience.

The core of I2C software
----------------------------------------------------------------------
uint32_t I2C_func(uint32_t DevAddr, uint8_t* txdata, uint8_t* rxdata, uint32_t length){
uint32_t errWR;
AAAWR.sl_addr7bit=DevAddr>>1;//operation << in subroutine
AAAWR.tx_data=swap_01(txdata);
AAAWR.tx_length=length;
AAAWR.rx_data=rxdata;
AAAWR.rx_length=length;
AAAWR.retransmissions_max=0;
I2C_Cmd(I2CDEV_M,ENABLE);
errWR=I2C_MasterTransferData(I2CDEV_M, &AAAWR, I2C_TRANSFER_POLLING);
I2C_DeInit(I2CDEV_M);
return errWR;
}
----------------------------------------------------------------------

Shiggy


Outcomes