Showing results for 
Show  only  | Search instead for 
Did you mean: 
Registered: ‎05-29-2015

PS i2c (from PMOD) mostly working on microzed

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:


Instance 1:

   Failed to read register 0x00 on the first register dump, and then failed to read register 0x08 in the second. The write was fine.


Instance 2:

   Failed to read 0x06 on second register dump, write was fine.


Instance 3:

   Success every time.


We are using the "cdns,i2c-r1p14" driver (i2c-cadence driver). Here's our device tree entry:

                i2c0: i2c@e0004000 {
                        bus-id = <0>;
                        clock-frequency = <100000>;
                        clocks = <&clkc 38>;
                        compatible = "cdns,i2c-r1p14";
                        interrupt-parent = <&intc>;
                        interrupts = <0 25 4>;
                        reg = <0xe0004000 0x1000>;
                        xlnx,has-interrupt = <0x0>;
                        xlnx,i2c-reset = "";


Here's a snap of the PS configuration:




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?



0 Kudos
0 Replies