This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AFE4404EVM: Communication problems with AFE4404EVM(I2C)

Part Number: AFE4404EVM

Hello,

I'm trying to control the AFE 4404 EVM with and Arduino board. But I'm having problems with I2C communication. I recive the ACK pulse after sending the address and after sending data, but the device is not working and If I try to read out the registers(data configuration) all i get is :0x0...

I copyed the configuration registers from the AFE 4404 EVM gui. The power supply are as follow:

RX_SUP=3.3V

IO_SUP=3.3V

TX_SUP=5V

I2C_SCL=4.8V

I2C_SDA=4.8V

I2C clock is working at 400kHz.


Do you know what can I do?

Thank you in advance, Joan

  • Hi Joan,

    Can you please verify you I2C read routine?
    Write some value to register 0x1D and try to read. Also before you read any register you have to set REG_READ bit ( i.e. 0x00<0>).
    If you are not able to read then something is wrong in read routine and you can observe the I2C lines on oscilloscope to verify/debug this.

    Regards,
    Prabin.
  • Hello Prabin,

    First of all thank you for your quick answer. I tryed to do what you recomend to me but unfortunately the kit suddently stop working and now even the LEDs don't work after connect the board to the PC. So why are going to buy a new one. I will let you know when we get some result.

    Regards, Joan.

  • Hello Prabin,

    I got a new AFE 4404 EVM kit. I take a look at the I2C rotunie I was using and I note it was wrong(following the AFE 4404 datasheet) because I was not setting the  R/W bit. However it is still not working and I'm afraid of connect it to an oscilloscope because last time it broke down after connect it(this is really strange I know). On the other hand, you told me to set REG_READ to 0 but I read in page 21 of AFE 4404 datashed: "Prior to reading out any other register, the REG_READbit needs to be additionally set to '1' ". Maybe if you see the two function I'm using you can tell me some clue.

    void I2C_write (int slave_address, byte reg_address, unsigned long configData)
    {
     
      int ACK;
      Wire.beginTransmission( slave_address << 1);
      Wire.write(reg_address);
      Wire.write( (configData >> 16) & 0xFF);
      Wire.write( (configData >> 8) & 0xFF);
      Wire.write( (configData) & 0xFF);
      ACK=Wire.endTransmission();
      Serial.print(";Wire end transmission=");
      Serial.print(ACK);
      
    }
    
    void I2C_Read()  {
    
        int m=0;
        int byteCount=3;
        int NACK;
         
        Wire.beginTransmission(0x58 << 1);
        Wire.write(0x1D);
        Wire.beginTransmission(0x58 << 1 |0x01);
        
        Wire.requestFrom(0x1D, 3);
        while(Wire.available() && (byteCount != 0))
        {
        V_code[m]=Wire.read();
        
        byteCount--;
        m++;
        }
        NACK=Wire.endTransmission();
        Serial.print(";NACK=");
        Serial.print(NACK);
      
      
        return(V_code);
     
        
    }   

    Thank you in advance, Joan

  • Hello Prabin,

    Finally now is working. There was something wrong with the code. Here is the read/write function that work, maybe someone have the same problem and the code can help...

    void I2C_write (byte slave_address, byte reg_address, unsigned long configData)
    {

    int ACK;
    Wire.beginTransmission(slave_address);
    Wire.write(reg_address);
    Wire.write( (configData >> 16) & 0xFF);
    Wire.write( (configData >> 8) & 0xFF);
    Wire.write( (configData) & 0xFF);
    ACK=Wire.endTransmission();
    Serial.print(";Wire end transmission=");
    Serial.print(ACK);

    }

    void I2C_read(byte slave_address, byte reg_address, byte byteCount) {

    int m=0;

    int NACK;
    Wire.beginTransmission(slave_address);
    Wire.write(reg_address);
    Wire.endTransmission(false);
    Wire.requestFrom(slave_address,byteCount,true);
    V_code[2] = Wire.read();
    V_code[1] = Wire.read();
    V_code[0] = Wire.read();
    /*NACK=Wire.endTransmission();


    VALUE=V_code[2]<<16 + V_code[1]<<8 + V_code[0];

    return(VALUE);


    }

    Thank you for your help