I'm having some trouble connecting the microzed PS i2c port (from the PMOD connector MIO-10 and MIO-11) to an external ADC (CS5368). The microzed needs to send some i2c commands to the ADC to configure it. I have it mostly working, in that I can read and write to all the registers, but sometimes it fails with a: "write before read: No such device or address" error.
Snippet of output from our code is attached, we ran it three times with varrying results:
Failed to read register 0x00 on the first register dump, and then failed to read register 0x08 in the second. The write was fine.
Failed to read 0x06 on second register dump, write was fine.
Success every time.
We are using the "cdns,i2c-r1p14" driver (i2c-cadence driver). Here's our device tree entry:
Is it not working because I don't have an interrupt assigned to it (has-interrupt <0x00>)? How do we assign the i2c0 interrupt from the PS to my interrupt controller? Do I even need to do that? We are using 10K external pull-ups, could that be the issue?