AnsweredAssumed Answered

AD524x - I2C digital potentiometer doesn't send an ACK

Question asked by Padbol on Apr 6, 2012
Latest reply on Apr 6, 2012 by Padbol

Hello,

 

I'm experiencing a weird behavior of an AD5241 digital potentiometer during I2C transferts.

 

I'm sending three bytes to the component following the datasheet instructions: Component address, Instruction and Data.

 

For each of these three bytes, the peripherical never reply with an ACK - The 9th bit is always set.

 

I read on the internet that is a recurrent issue but no one seems to know how to get out of this trouble.

 

Have you ever experienced that problem?  How could I make the digital potentiometer sending an ACK?  Is there any initialisation phase to proceed which is not detailed in the datasheet?

 

I thank you so much in advance,

Sébastien M.

 

*** Following : Function written in C30 to send data to the AD5241 ***

void Write_Pot(unsigned int Instructions, unsigned int ResistorValue)

{

    unsigned int Position;

    // --------------------------------------------------------------------------------   

    Position = ((ResistorValue-60)*256)/Rab;// Convert resistor value to wiper position

    // --------------------------------------------------------------------------------

    Init_I2C(400);                // Open I2C at 400kHz

    IdleI2C();                // Wait bus Idle

 

    StartI2C();                // Start condition

    while(I2CCONbits.SEN);            // Wait end of start condition

 

    MasterWriteI2C(AD_WriteAddress);    // Send component address

    while(I2CSTATbits.TRSTAT);        // Wait end of transmission and ACK

 

    MasterWriteI2C(Instructions & 0x00FF);    // Send instructions bits

    while(I2CSTATbits.TRSTAT);

 

    MasterWriteI2C(Position & 0x00FF);    // Send wiper position

    while(I2CSTATbits.TRSTAT);

 

    StopI2C();                // Stop condition

    CloseI2C();                // Close I2C

}

Attachments

Outcomes