Sorry, you need to enable JavaScript to visit this website.

Microzed I2C clock speed

Zedboard forums is currently read-only while it under goes maintenance.

Unsolved
2 posts / 0 new
dbbt
Junior(0)
Microzed I2C clock speed

Does anybody have any idea how to set the clock frequency of the PS I2C interface of a microzed running petalinux? Ideally this could be done by an application at runtime but this appears not to be possible.
The only way I have found to do it is to manually edit the pcw.dtsi files created by petalinux-config.
The relevant line is
    clock-frequency = <400000>;
That is not really satisfactory as one day I'll make a change and forget and my devices will fail in the field.
And on a related topic, when I do set it to 400000 I get 285kHz. When I set it to 100000 I get 90kHz. Setting it to 250000 gives you 196kHz. I realise that there are only integer dividers so not all frequencies are possible but my calcs suggest we should get a lot closer. 

fletch
Moderator(23)
Hello @dbbt,

Hello @dbbt,

It sounds like this is not specific to the MicroZed but rather something specific to Zynq-7000 and the Cadence PS I2C hardware and driver. You should definitely request this information on the Xilinx forums as they have detailed product experts who can help as well.

I did a bit of searching to get you started, and it looks like you are not the only one having similar issues. Check these out, and then I'd encourage you to open your own forum post with Xilinx.

https://forums.xilinx.com/t5/Embedded-Linux/i2c-cadence-driver-frequency-in-petalinux/td-p/744270

https://forums.xilinx.com/t5/Embedded-Development-Tools/Petalinux-2016-4-I2C-problem/td-p/788464

https://forums.xilinx.com/t5/Embedded-Linux/Cadence-I2C-Clock-Frequency/td-p/759420

https://forums.xilinx.com/t5/Embedded-Processor-System-Design/Adjust-I2C-clock-on-iic0-interface/td-p/562906

 

Bryan