[imx6qp] i2c clock setting

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[imx6qp] i2c clock setting

1,300 Views
taroyamamoto
Contributor III

Hi team,

I tried to change the i2C clock to 100KHz.

i2c_imx says following, in my understanding is 24000000 / 240 = 100000.

  <i2c_imx_set_clk> I2C_CLK=24000000, REQ DIV=240

  <i2c_imx_set_clk> IFDR[IC]=0xf, REAL DIV=240

*clock source is "clk24m"

But,I checked the SCL line using oscilloscope, I can see about 255KHz.....

If source clock changed to "ipg"(66MHz), i2c_imx says,

  <i2c_imx_set_clk> I2C_CLK=66000000, REQ DIV=660

  <i2c_imx_set_clk> IFDR[IC]=0x39, REAL DIV=768

calculated clock value is 66000000 / 768 = 85937.5, and I can see about 86KHz on the SCL line(probably correct).

So , I wanted to check the value of IFDR register, but the memtool returned "Bus error".

[Question]

1. When the clock source is a 24MHz, why correct setting is not performed?

2. Why memtool returned "Bus Error" ?

regards,

Taro.

Labels (1)
0 Kudos
Reply
2 Replies

925 Views
Yuri
NXP Employee
NXP Employee

Hello,

  The following comments - I hope - helps.

I2C_clock.jpg

The I2C uses PERCLK_ROOT as its clock source. PERCLK_ROOT is derived from

IPG_CLK_ROOT. The IPG_CLK_ROOT runs at 66 MHz with default dividers, as

shown in the above figure.

Have a great day,
Yuri

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

0 Kudos
Reply

925 Views
taroyamamoto
Contributor III

Hi Yuri,

Thank you for your replay

My understanding are....

1. I2C clock source can be used only IPG.
2. Be set to 100KHz, actually it becomes 86KHz.
3. Just the output of 100KHz or 400KHz is impossible.

Correct ?

Thanks,

Taro

0 Kudos
Reply