I2C frequency - MKL33Z64VLH4

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

I2C frequency - MKL33Z64VLH4

ソリューションへジャンプ
1,723件の閲覧回数
srcoolz
Contributor II

Hello Guys,

I'm using MKL33Z64VLH4 at 16Mhz core frequency and I have connected an EEPROM on I2C1 and set it up for 400Khz operation. Based on the I2C_MasterSetBaudRate function, the ICR is set for 07 (SCL divider 40) and Mult is set to 00 (value 1).

In this case 16Mhz is divided by 40 to produce 400Khz. However, if I use the oscilloscope to watch the SCL pin, the frequency is around 350Khz. Can someone please help me understand the reason for the difference in frequency? The EEPROM does not perform clock stretching.

Thank you

Regards

Santhosh

0 件の賞賛
返信
1 解決策
1,633件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Santhosh Ramani,

    Please read this in the reference manual at first:

pastedImage_1.png

So, if you want to get the precise clk, I don't recommend you to use ICR=0X00-0X0F.

Please choose ICR>0X10, you can use higher core clock, then use larger ICR to get 400Khz.

Please try again on your side with my recommendation.

If you still have question, please let me know!


Have a great day,
Kerry

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

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,634件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Santhosh Ramani,

    Please read this in the reference manual at first:

pastedImage_1.png

So, if you want to get the precise clk, I don't recommend you to use ICR=0X00-0X0F.

Please choose ICR>0X10, you can use higher core clock, then use larger ICR to get 400Khz.

Please try again on your side with my recommendation.

If you still have question, please let me know!


Have a great day,
Kerry

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

0 件の賞賛
返信
1,633件の閲覧回数
srcoolz
Contributor II

Hello Kerry,

Thanks for the reply. I had referred to the table, but I missed the note at the top. 

Regards

Santhosh

0 件の賞賛
返信
1,633件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Santhosh Ramanni,

     Do you have any other question about this topic?

     If you still have question, just let me know!

     If your question is solved, please help to mark the close answer to close this case.

     Thank you!


Have a great day,
Kerry

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

0 件の賞賛
返信