Hello all,
i am trying to use the I"C module on the KEA128. I set the baud rate to be ca. 357 kbps but if i measure the SCL line i get something like 312 kbps!!
my setting:
Bus frequency: 20 MHz
I2C0_F = 0x11 -> SCL divider=56 and MULT = 1
from datasheet:
I2C baud rate = I2C module clock speed (Hz)/(mul × SCL divider)
so the baud rate = 20Mhz/(1*56) = 357 kbps
but the measured SCL gives 312 kbps!!
did i miss anything to set? or is there anything that iam doing wrong?
thank you in advance
Hani
Hi Hani,
PTH2 can be used to output the bus clock, please set the SIM_SOPT0[CLKOE] and check the frequency of bus clock.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Robin,
thank you for your reply.
i checked the Bus frequency and it is 20MHz. I am suing the Bus freq. in other modules like timers and seems to work correctly, so i do not think that the Bus frequency is the problem.
it is really important to have the correct baud rate, we plan to use the bus on ca. 1 Mio. Controller.
Best regards,
Hani
Would you please attached your project here?
So that I can direct test it on my FRDM-KEAZ128 or TRK-KEA128 board.
Hi Robin,
did you find anything?
regards, Hani
During debug, the bus clock on PTH2 is 20MHz and the frequency of I2C is 357 kbps.
But after re-power on, the bus clock will decrease which decrease the frequency of I2C.
Didn't you find the same phenomenon on PTH2?
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Robin,
we got for our project first electronic samples. And i have the same problem, it is even worst. With a SCL divider of 0x11 (56) i got 294kbs on the SCL line!
i mesured the BUS frequency and its is 20MHz. attached you can find two pictures (I2C0 modul and SIM.SCGC register) that might be help. Do you have any idea? what could be the problem?
Best regards,
Hani
hi Robin,
i am getting 20MHz Bus frequency and 312kbps I2C in the debug and in normal mode!
regards, Hani