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.

AFE4404: Writing Registers Through i2C in python

Part Number: AFE4404

I'm having issues configuring the device using python. I was able to confirm successful operation in C on Arduino, so the hardware works.

For some reason, I'm only able to write to the read/write register (0x00). Every other register returns a value of 0x00 after being written. I'm using the Adafruit_GPIO.I2C library and I've also tried the smbus library but received the same result.

sensor.device.write8(0x00, 0) #Enables write

sensor.device.write8(0x0a, 255) #Writes value of 255 to 0x0a

sensor.device.write8(0x00, 1) #Enables read

sensor.device.readList(0x00, 1) #read 1 byte from 0x00

sensor.device.write8(0x0a, 1) #read 1 byte from 0x0a

  • Hi Marc,

    In AFE4404, all the registers are 24 bits wide, so for register write you need to write 3 bytes (24 bits) to a given register. Also while reading you have to read 3 bytes from a register. From your waveform, I see that you are writing/ reading only 1 byte to/from register.

    Register 0x00 is write only register, so could you please give it a try without reading 0x00 register.

    Regards,

    Prabin.