I2C frequency - MKL33Z64VLH4

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

I2C frequency - MKL33Z64VLH4

Jump to solution
1,043 Views
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 Kudos
Reply
1 Solution
953 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
3 Replies
954 Views
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 Kudos
Reply
953 Views
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 Kudos
Reply
953 Views
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 Kudos
Reply