How to set lower frequency of I2C bus on i.MX6DualLite

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set lower frequency of I2C bus on i.MX6DualLite

79 Views
Contributor I
Hi,
we're developing an application (using YOCTO Linux) with the iMX6DL and we're having some issues trying to set the i2c clock-frequency under a certain value... Reading in the reference manual we understood that the root cause of the issue is the PER_CLK_ROOT which is set at 66MHz: our ahb_podf is 3, the ipg_pdf is 2 and the perclk_podf is 1. With the maximum value of the i2c prescaler (which is 3840) we get a minimum i2c frequency of 17KHz. Our ideal value would be around 5KHz. 
 
In the device tree we set "

&i2c2 {

status = “okay”;

clock-frequency = “<5000>”;

};"

but any value under 20000 is not working (although the kernel gets the correct value in /sys/class/i2c-dev/i2c-0/device/of_node/clock-frequency". 

We understand that there are many other peripheral connected to the PER_CLK_ROOT, like PWM and GPT but maybe there is a way to change it (maybe modifying the perclk_podf) that can prevent any other issues... 
Labels (1)
0 Kudos
1 Reply

27 Views
NXP TechSupport
NXP TechSupport

Hi Davide

one can try to debug it in clk driver and (if necessary) to reprogram parent pll to lower frequency:

clk-imx6q.c\imx\clk\drivers - linux-imx - i.MX Linux kernel 

May be useful to check linux common clock framework documentation:

https://www.kernel.org/doc/Documentation/clk.txt 

http://elinux.org/images/b/b8/Elc2013_Clement.pdf 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos