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
Solved! Go to Solution.
Hi Santhosh Ramani,
Please read this in the reference manual at first:
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!
-----------------------------------------------------------------------------------------------------------------------
Hi Santhosh Ramani,
Please read this in the reference manual at first:
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!
-----------------------------------------------------------------------------------------------------------------------
Hello Kerry,
Thanks for the reply. I had referred to the table, but I missed the note at the top.
Regards
Santhosh
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!
-----------------------------------------------------------------------------------------------------------------------