Hi everybody!
When configing the I2C module in MPC5748G, there is something puzzle me about the frequency of the SCL for I2C bus. For example, IBFD=0x20
what's the unit of the number 160, 17, 78, 81? stands for how long time?
What should I do if I want to have a 400KHz I2C bus?
Hi,
The I2C module is clocked from F40 clock group (max 40MHz). The IBFD[IBC] field is used to divide this module clock to give desired bit rate.
If you want for example 100kHz I2C bus then simply calculate divider as
divider = F40 / bit rate = 40MHz / 100kHz = 400.
Now from Table 44-11 find closest SCL divider and use respective IBC value.
So you can select SCL divider = 416 and IBFD = 0x96.
The SCL Divider, SDA Hold and SCL Hold (start/stop) values represent time duration in number of module clock.
For 400kHz I2C bus, assuming max 40MHz module clock, you get divider = 100, then select IBFD = 0x16.
BR, Petr
Hi, Petr
Thank you very much for your help! I will do it later.
Best Regards,
Qiang